Title: [232203] trunk/Source/WebKit
Revision
232203
Author
[email protected]
Date
2018-05-25 14:35:30 -0700 (Fri, 25 May 2018)

Log Message

WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback() unexpectedly constructs a process pool
https://bugs.webkit.org/show_bug.cgi?id=185992

Reviewed by Geoffrey Garen.

Update enableResourceLoadStatisticsAndSetTestingCallback() to pass the right parameter to processPools()
to avoid constructing a process pool when none exist. Also drop the 'resourceLoadStatisticsEnabled'
flag on the WebProcessPool and have it query its data store instead to know if the feature is enabled.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
* UIProcess/WebProcessPool.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (232202 => 232203)


--- trunk/Source/WebKit/ChangeLog	2018-05-25 21:35:13 UTC (rev 232202)
+++ trunk/Source/WebKit/ChangeLog	2018-05-25 21:35:30 UTC (rev 232203)
@@ -1,5 +1,23 @@
 2018-05-25  Chris Dumez  <[email protected]>
 
+        WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback() unexpectedly constructs a process pool
+        https://bugs.webkit.org/show_bug.cgi?id=185992
+
+        Reviewed by Geoffrey Garen.
+
+        Update enableResourceLoadStatisticsAndSetTestingCallback() to pass the right parameter to processPools()
+        to avoid constructing a process pool when none exist. Also drop the 'resourceLoadStatisticsEnabled'
+        flag on the WebProcessPool and have it query its data store instead to know if the feature is enabled.
+
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::initializeNewWebProcess):
+        (WebKit::WebProcessPool::setResourceLoadStatisticsEnabled):
+        * UIProcess/WebProcessPool.h:
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
+
+2018-05-25  Chris Dumez  <[email protected]>
+
         Drop support for NSURLCache in WebKit2
         https://bugs.webkit.org/show_bug.cgi?id=185990
 

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (232202 => 232203)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-05-25 21:35:13 UTC (rev 232202)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2018-05-25 21:35:30 UTC (rev 232203)
@@ -942,7 +942,7 @@
         parameters.waylandCompositorDisplayName = WaylandCompositor::singleton().displayName();
 #endif
 
-    parameters.resourceLoadStatisticsEnabled = resourceLoadStatisticsEnabled();
+    parameters.resourceLoadStatisticsEnabled = websiteDataStore.resourceLoadStatisticsEnabled();
 #if ENABLE(MEDIA_STREAM)
     parameters.shouldCaptureAudioInUIProcess = m_configuration->shouldCaptureAudioInUIProcess();
 #endif
@@ -1368,7 +1368,6 @@
 
 void WebProcessPool::setResourceLoadStatisticsEnabled(bool enabled)
 {
-    m_resourceLoadStatisticsEnabled = enabled;
     sendToAllProcesses(Messages::WebProcess::SetResourceLoadStatisticsEnabled(enabled));
 }
 

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (232202 => 232203)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2018-05-25 21:35:13 UTC (rev 232202)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2018-05-25 21:35:30 UTC (rev 232203)
@@ -414,7 +414,6 @@
     static String legacyPlatformDefaultNetworkCacheDirectory();
     static String legacyPlatformDefaultJavaScriptConfigurationDirectory();
 
-    bool resourceLoadStatisticsEnabled() { return m_resourceLoadStatisticsEnabled; }
     void setResourceLoadStatisticsEnabled(bool);
     void clearResourceLoadStatistics();
 
@@ -631,7 +630,6 @@
 #endif
 
     bool m_memoryCacheDisabled { false };
-    bool m_resourceLoadStatisticsEnabled { false };
     bool m_javaScriptConfigurationFileEnabled { false };
     bool m_alwaysRunsAtBackgroundPriority;
     bool m_shouldTakeUIBackgroundAssertion;

Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (232202 => 232203)


--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2018-05-25 21:35:13 UTC (rev 232202)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp	2018-05-25 21:35:30 UTC (rev 232203)
@@ -1477,7 +1477,7 @@
     m_resourceLoadStatistics = WebResourceLoadStatisticsStore::create(m_configuration.resourceLoadStatisticsDirectory, WTFMove(callback), m_sessionID.isEphemeral());
 #endif
 
-    for (auto& processPool : processPools())
+    for (auto& processPool : processPools(std::numeric_limits<size_t>::max(), false))
         processPool->setResourceLoadStatisticsEnabled(true);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to