Title: [223436] trunk/Source
Revision
223436
Author
[email protected]
Date
2017-10-16 13:52:04 -0700 (Mon, 16 Oct 2017)

Log Message

Log using differential privacy domains where the WebContent process crashes
https://bugs.webkit.org/show_bug.cgi?id=178346
<rdar://problem/33293830>

Reviewed by Alex Christensen.

Source/WebCore:

Add new diagnostic logging key for domain causing crashes.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
* page/DiagnosticLoggingKeys.h:

Source/WebKit:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reload):
(WebKit::WebPageProxy::currentURL const):
(WebKit::WebPageProxy::processDidTerminate):
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didClose):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223435 => 223436)


--- trunk/Source/WebCore/ChangeLog	2017-10-16 20:50:23 UTC (rev 223435)
+++ trunk/Source/WebCore/ChangeLog	2017-10-16 20:52:04 UTC (rev 223436)
@@ -1,3 +1,17 @@
+2017-10-16  Chris Dumez  <[email protected]>
+
+        Log using differential privacy domains where the WebContent process crashes
+        https://bugs.webkit.org/show_bug.cgi?id=178346
+        <rdar://problem/33293830>
+
+        Reviewed by Alex Christensen.
+
+        Add new diagnostic logging key for domain causing crashes.
+
+        * page/DiagnosticLoggingKeys.cpp:
+        (WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
+        * page/DiagnosticLoggingKeys.h:
+
 2017-10-16  Sam Weinig  <[email protected]>
 
         [Settings] Remove all custom code from Settings.h/cpp

Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (223435 => 223436)


--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2017-10-16 20:50:23 UTC (rev 223435)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2017-10-16 20:52:04 UTC (rev 223436)
@@ -343,6 +343,11 @@
     return ASCIILiteral("documentLoaderStopping");
 }
 
+String DiagnosticLoggingKeys::domainCausingCrashKey()
+{
+    return ASCIILiteral("DomainCausingCrash");
+}
+
 String DiagnosticLoggingKeys::domainCausingEnergyDrainKey()
 {
     return ASCIILiteral("DomainCausingEnergyDrain");

Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (223435 => 223436)


--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h	2017-10-16 20:50:23 UTC (rev 223435)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.h	2017-10-16 20:52:04 UTC (rev 223436)
@@ -49,6 +49,7 @@
     static String diskCacheKey();
     static String diskCacheAfterValidationKey();
     static String documentLoaderStoppingKey();
+    WEBCORE_EXPORT static String domainCausingCrashKey();
     static String domainCausingEnergyDrainKey();
     WEBCORE_EXPORT static String domainCausingJetsamKey();
     WEBCORE_EXPORT static String simulatedPageCrashKey();

Modified: trunk/Source/WebKit/ChangeLog (223435 => 223436)


--- trunk/Source/WebKit/ChangeLog	2017-10-16 20:50:23 UTC (rev 223435)
+++ trunk/Source/WebKit/ChangeLog	2017-10-16 20:52:04 UTC (rev 223436)
@@ -1,3 +1,19 @@
+2017-10-16  Chris Dumez  <[email protected]>
+
+        Log using differential privacy domains where the WebContent process crashes
+        https://bugs.webkit.org/show_bug.cgi?id=178346
+        <rdar://problem/33293830>
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::reload):
+        (WebKit::WebPageProxy::currentURL const):
+        (WebKit::WebPageProxy::processDidTerminate):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::didClose):
+
 2017-10-16  Youenn Fablet  <[email protected]>
 
         Activate Cache API by default

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (223435 => 223436)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2017-10-16 20:50:23 UTC (rev 223435)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2017-10-16 20:52:04 UTC (rev 223436)
@@ -1073,10 +1073,7 @@
 {
     SandboxExtension::Handle sandboxExtensionHandle;
 
-    String url = ""
-    if (url.isEmpty() && m_backForwardList->currentItem())
-        url = ""
-
+    String url = ""
     if (!url.isEmpty()) {
         auto transaction = m_pageLoadState.transaction();
         m_pageLoadState.setPendingAPIRequestURL(transaction, url);
@@ -5440,6 +5437,14 @@
     m_pageLoadState.didChangeProcessIsResponsive();
 }
 
+String WebPageProxy::currentURL() const
+{
+    String url = ""
+    if (url.isEmpty() && m_backForwardList->currentItem())
+        url = ""
+    return url;
+}
+
 void WebPageProxy::processDidTerminate(ProcessTerminationReason reason)
 {
     ASSERT(m_isValid);
@@ -5446,10 +5451,7 @@
 
 #if PLATFORM(IOS)
     if (m_process->isUnderMemoryPressure()) {
-        String url = ""
-        if (url.isEmpty() && m_backForwardList->currentItem())
-            url = ""
-        String domain = WebCore::topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, url).host());
+        String domain = WebCore::topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, currentURL()).host());
         if (!domain.isEmpty())
             logDiagnosticMessageWithEnhancedPrivacy(WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey(), domain, WebCore::ShouldSample::No);
     }

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (223435 => 223436)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2017-10-16 20:50:23 UTC (rev 223435)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2017-10-16 20:52:04 UTC (rev 223436)
@@ -423,6 +423,8 @@
     bool drawsBackground() const { return m_drawsBackground; }
     void setDrawsBackground(bool);
 
+    String currentURL() const;
+
     float topContentInset() const { return m_topContentInset; }
     void setTopContentInset(float);
 

Modified: trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp (223435 => 223436)


--- trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2017-10-16 20:50:23 UTC (rev 223435)
+++ trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp	2017-10-16 20:52:04 UTC (rev 223436)
@@ -50,6 +50,7 @@
 #include "WebUserContentControllerProxy.h"
 #include "WebsiteData.h"
 #include <WebCore/DiagnosticLoggingKeys.h>
+#include <WebCore/PublicSuffix.h>
 #include <WebCore/SuddenTermination.h>
 #include <WebCore/URL.h>
 #include <stdio.h>
@@ -626,6 +627,15 @@
 
     shutDown();
 
+#if ENABLE(PUBLIC_SUFFIX_LIST)
+    if (pages.size() == 1) {
+        auto& page = *pages[0];
+        String domain = topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, page.currentURL()).host());
+        if (!domain.isEmpty())
+            page.logDiagnosticMessageWithEnhancedPrivacy(WebCore::DiagnosticLoggingKeys::domainCausingCrashKey(), domain, WebCore::ShouldSample::No);
+    }
+#endif
+
     for (auto& page : pages)
         page->processDidTerminate(ProcessTerminationReason::Crash);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to