Title: [242183] trunk/Source/WebKit
Revision
242183
Author
[email protected]
Date
2019-02-27 16:57:37 -0800 (Wed, 27 Feb 2019)

Log Message

REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
https://bugs.webkit.org/show_bug.cgi?id=195072

Reviewed by Ryosuke Niwa.

ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
was disconnected), just like we do for other message send cases.

This patch switches from using the m_networkProcessConnection member (which might be null) to use the
'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (242182 => 242183)


--- trunk/Source/WebKit/ChangeLog	2019-02-28 00:54:19 UTC (rev 242182)
+++ trunk/Source/WebKit/ChangeLog	2019-02-28 00:57:37 UTC (rev 242183)
@@ -1,3 +1,21 @@
+2019-02-27  Brent Fulgham  <[email protected]>
+
+        REGRESSION: Crash beneath ResourceLoadObserver::logSubresourceLoading
+        https://bugs.webkit.org/show_bug.cgi?id=195072
+
+        Reviewed by Ryosuke Niwa.
+
+        ResourceLoadObserver and WebProcess should exist as long as the web page (process) is running. However,
+        the NetworkProcess connection can close for a variety of reasons. If the ResourceLoadObserver observes
+        a load or user gesture in the WebProcess, we should attempt to reconnect to the NetworkProcess (if it
+        was disconnected), just like we do for other message send cases.
+
+        This patch switches from using the m_networkProcessConnection member (which might be null) to use the
+        'ensureNetworkProcessConnection' accessor which ensures we have a valid connection for message sends.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+
 2019-02-27  Chris Dumez  <[email protected]>
 
         Flaky API Test: TestWebKitAPI.ProcessSwap.SessionStorage

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (242182 => 242183)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2019-02-28 00:54:19 UTC (rev 242182)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2019-02-28 00:57:37 UTC (rev 242183)
@@ -209,7 +209,7 @@
     ResourceLoadObserver::shared().setNotificationCallback([this] (Vector<ResourceLoadStatistics>&& statistics) {
         parentProcessConnection()->send(Messages::WebResourceLoadStatisticsStore::ResourceLoadStatisticsUpdated(WTFMove(statistics)), 0);
 
-        m_networkProcessConnection->connection().send(Messages::NetworkConnectionToWebProcess::RequestResourceLoadStatisticsUpdate(), 0);
+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RequestResourceLoadStatisticsUpdate(), 0);
     });
 
     ResourceLoadObserver::shared().setRequestStorageAccessUnderOpenerCallback([this] (const RegistrableDomain& domainInNeedOfStorageAccess, uint64_t openerPageID, const RegistrableDomain& openerDomain) {
@@ -404,19 +404,19 @@
 
 #if ENABLE(RESOURCE_LOAD_STATISTICS)
     ResourceLoadObserver::shared().setLogUserInteractionNotificationCallback([this] (PAL::SessionID sessionID, const RegistrableDomain& domain) {
-        m_networkProcessConnection->connection().send(Messages::NetworkConnectionToWebProcess::LogUserInteraction(sessionID, domain), 0);
+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::LogUserInteraction(sessionID, domain), 0);
     });
 
     ResourceLoadObserver::shared().setLogWebSocketLoadingNotificationCallback([this] (PAL::SessionID sessionID, const RegistrableDomain& targetDomain, const RegistrableDomain& topFrameDomain, WallTime lastSeen) {
-        m_networkProcessConnection->connection().send(Messages::NetworkConnectionToWebProcess::LogWebSocketLoading(sessionID, targetDomain, topFrameDomain, lastSeen), 0);
+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::LogWebSocketLoading(sessionID, targetDomain, topFrameDomain, lastSeen), 0);
     });
     
     ResourceLoadObserver::shared().setLogSubresourceLoadingNotificationCallback([this] (PAL::SessionID sessionID, const RegistrableDomain& targetDomain, const RegistrableDomain& topFrameDomain, WallTime lastSeen) {
-        m_networkProcessConnection->connection().send(Messages::NetworkConnectionToWebProcess::LogSubresourceLoading(sessionID, targetDomain, topFrameDomain, lastSeen), 0);
+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::LogSubresourceLoading(sessionID, targetDomain, topFrameDomain, lastSeen), 0);
     });
 
     ResourceLoadObserver::shared().setLogSubresourceRedirectNotificationCallback([this] (PAL::SessionID sessionID, const RegistrableDomain& sourceDomain, const RegistrableDomain& targetDomain) {
-        m_networkProcessConnection->connection().send(Messages::NetworkConnectionToWebProcess::LogSubresourceRedirect(sessionID, sourceDomain, targetDomain), 0);
+        ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::LogSubresourceRedirect(sessionID, sourceDomain, targetDomain), 0);
     });
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to