@@ -53,6 +53,7 @@ static const Seconds s_pollInterval = 30_s;
5353// This file contains the amount of video memory used, and will be filled by some other
5454// platform component. It's a text file containing an unsigned integer value.
5555static String s_GPUMemoryFile;
56+ static ssize_t s_envBaseThresholdVideo = 0 ;
5657
5758static bool isWebProcess ()
5859{
@@ -135,7 +136,9 @@ MemoryPressureHandler::MemoryPressureHandler()
135136 units = MB;
136137 if (units != 1 )
137138 value = value.substring (0 , value.length () - 1 );
138- m_configuration.baseThresholdVideo = parseInteger<size_t >(value).value_or (0 ) * units;
139+ s_envBaseThresholdVideo = parseInteger<size_t >(value).value_or (0 ) * units;
140+ if (s_envBaseThresholdVideo)
141+ m_configuration.baseThresholdVideo = s_envBaseThresholdVideo;
139142 }
140143 }
141144}
@@ -348,6 +351,20 @@ void MemoryPressureHandler::endSimulatedMemoryPressure()
348351 memoryPressureStatusChanged ();
349352}
350353
354+ void MemoryPressureHandler::setConfiguration (Configuration&& configuration)
355+ {
356+ m_configuration = WTFMove (configuration);
357+ if (s_envBaseThresholdVideo)
358+ m_configuration.baseThresholdVideo = s_envBaseThresholdVideo;
359+ }
360+
361+ void MemoryPressureHandler::setConfiguration (const Configuration& configuration)
362+ {
363+ m_configuration = configuration;
364+ if (s_envBaseThresholdVideo)
365+ m_configuration.baseThresholdVideo = s_envBaseThresholdVideo;
366+ }
367+
351368void MemoryPressureHandler::releaseMemory (Critical critical, Synchronous synchronous)
352369{
353370 if (!m_lowMemoryHandler)
0 commit comments