Title: [264414] trunk/Source/WebKit
Revision
264414
Author
[email protected]
Date
2020-07-15 12:38:00 -0700 (Wed, 15 Jul 2020)

Log Message

Improve navigation policy decision release logging to help better diagnose issues
https://bugs.webkit.org/show_bug.cgi?id=214368

Reviewed by Alex Christensen.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (264413 => 264414)


--- trunk/Source/WebKit/ChangeLog	2020-07-15 19:20:21 UTC (rev 264413)
+++ trunk/Source/WebKit/ChangeLog	2020-07-15 19:38:00 UTC (rev 264414)
@@ -1,5 +1,19 @@
 2020-07-15  Chris Dumez  <[email protected]>
 
+        Improve navigation policy decision release logging to help better diagnose issues
+        https://bugs.webkit.org/show_bug.cgi?id=214368
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::didReceivePolicyDecision):
+
+2020-07-15  Chris Dumez  <[email protected]>
+
         [WK2] Make establishing a connection between the WebProcess and the Network process more robust
         https://bugs.webkit.org/show_bug.cgi?id=214307
         <rdar://problem/64592340>

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (264413 => 264414)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-07-15 19:20:21 UTC (rev 264413)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2020-07-15 19:38:00 UTC (rev 264414)
@@ -5163,8 +5163,10 @@
     navigation->setDestinationFrameSecurityOrigin(frameInfo.securityOrigin);
 
 #if ENABLE(CONTENT_FILTERING)
-    if (frame.didHandleContentFilterUnblockNavigation(request))
+    if (frame.didHandleContentFilterUnblockNavigation(request)) {
+        RELEASE_LOG_ERROR_IF_ALLOWED(Process, "Ignoring request to load this main resource because it was handled by content filter");
         return receivedPolicyDecision(PolicyAction::Ignore, m_navigationState->navigation(navigationID), nullptr, WTFMove(sender));
+    }
 #endif
 
     ShouldExpectSafeBrowsingResult shouldExpectSafeBrowsingResult = ShouldExpectSafeBrowsingResult::Yes;

Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (264413 => 264414)


--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2020-07-15 19:20:21 UTC (rev 264413)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp	2020-07-15 19:38:00 UTC (rev 264414)
@@ -901,6 +901,7 @@
 {
     auto* webPage = m_frame->page();
     if (!webPage) {
+        WEBFRAMELOADERCLIENT_RELEASE_LOG_ERROR(Network, "dispatchDecidePolicyForNavigationAction: ignoring because there's no web page");
         function(PolicyAction::Ignore, requestIdentifier);
         return;
     }
@@ -909,6 +910,7 @@
 
     // Always ignore requests with empty URLs. 
     if (request.isEmpty()) {
+        WEBFRAMELOADERCLIENT_RELEASE_LOG_ERROR(Network, "dispatchDecidePolicyForNavigationAction: ignoring because request is empty");
         function(PolicyAction::Ignore, requestIdentifier);
         return;
     }
@@ -920,6 +922,7 @@
     // Notify the bundle client.
     WKBundlePagePolicyAction policy = webPage->injectedBundlePolicyClient().decidePolicyForNavigationAction(webPage, m_frame.ptr(), action.ptr(), request, userData);
     if (policy == WKBundlePagePolicyActionUse) {
+        WEBFRAMELOADERCLIENT_RELEASE_LOG(Network, "dispatchDecidePolicyForNavigationAction: Injected Bundle responded with PolicyAction::Use");
         function(PolicyAction::Use, requestIdentifier);
         return;
     }
@@ -995,17 +998,21 @@
         PolicyDecision policyDecision;
 
         if (!webPage->sendSync(Messages::WebPageProxy::DecidePolicyForNavigationActionSync(m_frame->frameID(), m_frame->isMainFrame(), m_frame->info(), requestIdentifier, documentLoader->navigationID(), navigationActionData, originatingFrameInfoData, originatingPageID, navigationAction.resourceRequest(), request, IPC::FormDataReference { request.httpBody() }, redirectResponse, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())), Messages::WebPageProxy::DecidePolicyForNavigationActionSync::Reply(policyDecision))) {
+            WEBFRAMELOADERCLIENT_RELEASE_LOG_ERROR(Network, "dispatchDecidePolicyForNavigationAction: ignoring because of failing to send sync IPC");
             m_frame->didReceivePolicyDecision(listenerID, PolicyDecision { requestIdentifier, WTF::nullopt, PolicyAction::Ignore, 0, { }, { } });
             return;
         }
 
+        WEBFRAMELOADERCLIENT_RELEASE_LOG(Network, "dispatchDecidePolicyForNavigationAction: Got policyAction %u from sync IPC", (unsigned)policyDecision.policyAction);
         m_frame->didReceivePolicyDecision(listenerID, PolicyDecision { policyDecision.identifier, policyDecision.isNavigatingToAppBoundDomain, policyDecision.policyAction, 0, policyDecision.downloadID, { }});
         return;
     }
 
     ASSERT(policyDecisionMode == PolicyDecisionMode::Asynchronous);
-    if (!webPage->send(Messages::WebPageProxy::DecidePolicyForNavigationActionAsync(m_frame->frameID(), m_frame->info(), requestIdentifier, documentLoader->navigationID(), navigationActionData, originatingFrameInfoData, originatingPageID, navigationAction.resourceRequest(), request, IPC::FormDataReference { request.httpBody() }, redirectResponse, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()), listenerID)))
+    if (!webPage->send(Messages::WebPageProxy::DecidePolicyForNavigationActionAsync(m_frame->frameID(), m_frame->info(), requestIdentifier, documentLoader->navigationID(), navigationActionData, originatingFrameInfoData, originatingPageID, navigationAction.resourceRequest(), request, IPC::FormDataReference { request.httpBody() }, redirectResponse, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()), listenerID))) {
+        WEBFRAMELOADERCLIENT_RELEASE_LOG_ERROR(Network, "dispatchDecidePolicyForNavigationAction: ignoring because of failing to send async IPC");
         m_frame->didReceivePolicyDecision(listenerID, PolicyDecision { requestIdentifier, WTF::nullopt, PolicyAction::Ignore, 0, { }, { } });
+    }
 }
 
 void WebFrameLoaderClient::cancelPolicyCheck()

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (264413 => 264414)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-07-15 19:20:21 UTC (rev 264413)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2020-07-15 19:38:00 UTC (rev 264414)
@@ -3291,6 +3291,8 @@
 void WebPage::didReceivePolicyDecision(FrameIdentifier frameID, uint64_t listenerID, PolicyDecision&& policyDecision)
 {
     WebFrame* frame = WebProcess::singleton().webFrame(frameID);
+    RELEASE_LOG_IF_ALLOWED(Loading, "didReceivePolicyDecision: policyAction: %u - frameID: %llu - webFrame: %p - mainFrame: %d", (unsigned)policyDecision.policyAction, frameID.toUInt64(), frame, frame ? frame->isMainFrame() : 0);
+
     if (!frame)
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to