Changeset 223436 in webkit


Ignore:
Timestamp:
Oct 16, 2017 1:52:04 PM (7 years ago)
Author:
Chris Dumez
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):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r223432 r223436  
     12017-10-16  Chris Dumez  <cdumez@apple.com>
     2
     3        Log using differential privacy domains where the WebContent process crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=178346
     5        <rdar://problem/33293830>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Add new diagnostic logging key for domain causing crashes.
     10
     11        * page/DiagnosticLoggingKeys.cpp:
     12        (WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
     13        * page/DiagnosticLoggingKeys.h:
     14
    1152017-10-16  Sam Weinig  <sam@webkit.org>
    216
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp

    r220734 r223436  
    344344}
    345345
     346String DiagnosticLoggingKeys::domainCausingCrashKey()
     347{
     348    return ASCIILiteral("DomainCausingCrash");
     349}
     350
    346351String DiagnosticLoggingKeys::domainCausingEnergyDrainKey()
    347352{
  • trunk/Source/WebCore/page/DiagnosticLoggingKeys.h

    r220734 r223436  
    5050    static String diskCacheAfterValidationKey();
    5151    static String documentLoaderStoppingKey();
     52    WEBCORE_EXPORT static String domainCausingCrashKey();
    5253    static String domainCausingEnergyDrainKey();
    5354    WEBCORE_EXPORT static String domainCausingJetsamKey();
  • trunk/Source/WebKit/ChangeLog

    r223433 r223436  
     12017-10-16  Chris Dumez  <cdumez@apple.com>
     2
     3        Log using differential privacy domains where the WebContent process crashes
     4        https://bugs.webkit.org/show_bug.cgi?id=178346
     5        <rdar://problem/33293830>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * UIProcess/WebPageProxy.cpp:
     10        (WebKit::WebPageProxy::reload):
     11        (WebKit::WebPageProxy::currentURL const):
     12        (WebKit::WebPageProxy::processDidTerminate):
     13        * UIProcess/WebPageProxy.h:
     14        * UIProcess/WebProcessProxy.cpp:
     15        (WebKit::WebProcessProxy::didClose):
     16
    1172017-10-16  Youenn Fablet  <youenn@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r223413 r223436  
    10741074    SandboxExtension::Handle sandboxExtensionHandle;
    10751075
    1076     String url = m_pageLoadState.activeURL();
    1077     if (url.isEmpty() && m_backForwardList->currentItem())
    1078         url = m_backForwardList->currentItem()->url();
    1079 
     1076    String url = currentURL();
    10801077    if (!url.isEmpty()) {
    10811078        auto transaction = m_pageLoadState.transaction();
     
    54415438}
    54425439
     5440String WebPageProxy::currentURL() const
     5441{
     5442    String url = m_pageLoadState.activeURL();
     5443    if (url.isEmpty() && m_backForwardList->currentItem())
     5444        url = m_backForwardList->currentItem()->url();
     5445    return url;
     5446}
     5447
    54435448void WebPageProxy::processDidTerminate(ProcessTerminationReason reason)
    54445449{
     
    54475452#if PLATFORM(IOS)
    54485453    if (m_process->isUnderMemoryPressure()) {
    5449         String url = m_pageLoadState.activeURL();
    5450         if (url.isEmpty() && m_backForwardList->currentItem())
    5451             url = m_backForwardList->currentItem()->url();
    5452         String domain = WebCore::topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, url).host());
     5454        String domain = WebCore::topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, currentURL()).host());
    54535455        if (!domain.isEmpty())
    54545456            logDiagnosticMessageWithEnhancedPrivacy(WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey(), domain, WebCore::ShouldSample::No);
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r223413 r223436  
    424424    void setDrawsBackground(bool);
    425425
     426    String currentURL() const;
     427
    426428    float topContentInset() const { return m_topContentInset; }
    427429    void setTopContentInset(float);
  • trunk/Source/WebKit/UIProcess/WebProcessProxy.cpp

    r223191 r223436  
    5151#include "WebsiteData.h"
    5252#include <WebCore/DiagnosticLoggingKeys.h>
     53#include <WebCore/PublicSuffix.h>
    5354#include <WebCore/SuddenTermination.h>
    5455#include <WebCore/URL.h>
     
    627628    shutDown();
    628629
     630#if ENABLE(PUBLIC_SUFFIX_LIST)
     631    if (pages.size() == 1) {
     632        auto& page = *pages[0];
     633        String domain = topPrivatelyControlledDomain(WebCore::URL(WebCore::ParsedURLString, page.currentURL()).host());
     634        if (!domain.isEmpty())
     635            page.logDiagnosticMessageWithEnhancedPrivacy(WebCore::DiagnosticLoggingKeys::domainCausingCrashKey(), domain, WebCore::ShouldSample::No);
     636    }
     637#endif
     638
    629639    for (auto& page : pages)
    630640        page->processDidTerminate(ProcessTerminationReason::Crash);
Note: See TracChangeset for help on using the changeset viewer.