Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 164333: Add logging for "WebKit encountered an internal error" me…
…ssages due to Network process crashes

<https://webkit.org/b/164333>
<rdar://problem/29072727>

Reviewed by Alex Christensen.

Source/WebCore:

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
- Add implementation for new key method.
* page/DiagnosticLoggingKeys.h:
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
- Add declaration for new key method.

Source/WebKit2:

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
Add private method to log diagnostic message.
(WebKit::WebProcess::networkProcessConnectionClosed):
Call logDiagnosticMessageForNetworkProcessCrash().
* WebProcess/WebProcess.h:
(WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
Declare new method.


Canonical link: https://commits.webkit.org/182066@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208307 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ddkilzer committed Nov 2, 2016
1 parent c44250e commit 8f6df42
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
15 changes: 15 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,18 @@
2016-11-02 David Kilzer <ddkilzer@apple.com>

Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
<https://webkit.org/b/164333>
<rdar://problem/29072727>

Reviewed by Alex Christensen.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
- Add implementation for new key method.
* page/DiagnosticLoggingKeys.h:
(WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
- Add declaration for new key method.

2016-11-02 Filip Pizlo <fpizlo@apple.com>

The GC should be in a thread
Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/page/DiagnosticLoggingKeys.cpp
Expand Up @@ -133,6 +133,11 @@ String DiagnosticLoggingKeys::networkKey()
return ASCIILiteral("network");
}

String DiagnosticLoggingKeys::networkProcessCrashedKey()
{
return ASCIILiteral("networkProcessCrashed");
}

String DiagnosticLoggingKeys::neverSeenBeforeKey()
{
return ASCIILiteral("neverSeenBefore");
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/page/DiagnosticLoggingKeys.h
Expand Up @@ -77,6 +77,7 @@ class DiagnosticLoggingKeys {
WEBCORE_EXPORT static String needsRevalidationKey();
WEBCORE_EXPORT static String networkCacheKey();
static String networkKey();
WEBCORE_EXPORT static String networkProcessCrashedKey();
WEBCORE_EXPORT static String neverSeenBeforeKey();
static String noCacheKey();
static String noCurrentHistoryItemKey();
Expand Down
17 changes: 17 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,20 @@
2016-11-02 David Kilzer <ddkilzer@apple.com>

Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
<https://webkit.org/b/164333>
<rdar://problem/29072727>

Reviewed by Alex Christensen.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
Add private method to log diagnostic message.
(WebKit::WebProcess::networkProcessConnectionClosed):
Call logDiagnosticMessageForNetworkProcessCrash().
* WebProcess/WebProcess.h:
(WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
Declare new method.

2016-11-02 Alex Christensen <achristensen@webkit.org>

Remove Battery Status API from the tree
Expand Down
26 changes: 25 additions & 1 deletion Source/WebKit2/WebProcess/WebProcess.cpp
Expand Up @@ -74,6 +74,8 @@
#include <WebCore/DNS.h>
#include <WebCore/DatabaseManager.h>
#include <WebCore/DatabaseTracker.h>
#include <WebCore/DiagnosticLoggingClient.h>
#include <WebCore/DiagnosticLoggingKeys.h>
#include <WebCore/FontCache.h>
#include <WebCore/FontCascade.h>
#include <WebCore/Frame.h>
Expand Down Expand Up @@ -1081,13 +1083,35 @@ NetworkProcessConnection& WebProcess::networkConnection()
return *m_networkProcessConnection;
}

void WebProcess::logDiagnosticMessageForNetworkProcessCrash()
{
WebCore::Page* page = nullptr;

if (auto* webPage = focusedWebPage())
page = webPage->corePage();

if (!page) {
for (auto& webPage : m_pageMap.values()) {
if (auto* corePage = webPage->corePage()) {
page = corePage;
break;
}
}
}

if (page)
page->diagnosticLoggingClient().logDiagnosticMessage(WebCore::DiagnosticLoggingKeys::internalErrorKey(), WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey(), WebCore::ShouldSample::No);
}

void WebProcess::networkProcessConnectionClosed(NetworkProcessConnection* connection)
{
ASSERT(m_networkProcessConnection);
ASSERT_UNUSED(connection, m_networkProcessConnection == connection);

m_networkProcessConnection = nullptr;


logDiagnosticMessageForNetworkProcessCrash();

m_webLoaderStrategy.networkProcessCrashed();
}

Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit2/WebProcess/WebProcess.h
Expand Up @@ -307,6 +307,8 @@ class WebProcess : public ChildProcess {
void ensureAutomationSessionProxy(const String& sessionIdentifier);
void destroyAutomationSessionProxy();

void logDiagnosticMessageForNetworkProcessCrash();

// ChildProcess
void initializeProcess(const ChildProcessInitializationParameters&) override;
void initializeProcessName(const ChildProcessInitializationParameters&) override;
Expand Down

0 comments on commit 8f6df42

Please sign in to comment.