<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[179972] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/179972">179972</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-02-11 15:57:31 -0800 (Wed, 11 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[WK2] Add logging to validate the network cache efficacy (Part 2)
https://bugs.webkit.org/show_bug.cgi?id=141345
<rdar://problem/19632080>
Reviewed by Sam Weinig.
Source/WebCore:
Add a few more diagnostic logging keys for the network cache efficacy
logging.
Source/WebKit2:
Add diagnostic logging messages to validate the network cache efficacy.
The following 4 messages are added:
- networkCache / retrieval / success
- networkCache / retrieval / unhandledRequestFailure
- networkCache / retrieval / noLongerInCacheFailure
- networkCache / retrieval / unusableCachedEntryFailure
The messages are sent via IPC from the NetworkProcess to the UIProcess,
where the WebPageProxy code already handles diagnostic messages sent by
the WebProcess.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorepageDiagnosticLoggingKeyscpp">trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDiagnosticLoggingKeysh">trunk/Source/WebCore/page/DiagnosticLoggingKeys.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCachecpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStatisticsh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStatisticsCocoamm">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkNetworkProcessProxycpp">trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkNetworkProcessProxyh">trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkNetworkProcessProxymessagesin">trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebCore/ChangeLog        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-02-11 Chris Dumez <cdumez@apple.com>
+
+ [WK2] Add logging to validate the network cache efficacy (Part 2)
+ https://bugs.webkit.org/show_bug.cgi?id=141345
+ <rdar://problem/19632080>
+
+ Reviewed by Sam Weinig.
+
+ Add a few more diagnostic logging keys for the network cache efficacy
+ logging.
+
</ins><span class="cx"> 2015-02-11 Sam Weinig <sam@webkit.org>
</span><span class="cx">
</span><span class="cx"> REGRESSION(r179166): Crash when accessing document.dir on a document with no elements
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -945,6 +945,11 @@
</span><span class="cx"> __ZN7WebCore21CrossThreadCopierBaseILb0ELb0EN3WTF6StringEE4copyERKS2_
</span><span class="cx"> __ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_19IDBDatabaseMetadataEE4copyERKS1_
</span><span class="cx"> __ZN7WebCore21DiagnosticLoggingKeys10webViewKeyEv
</span><ins>+__ZN7WebCore21DiagnosticLoggingKeys12retrievalKeyEv
+__ZN7WebCore21DiagnosticLoggingKeys15networkCacheKeyEv
+__ZN7WebCore21DiagnosticLoggingKeys25noLongerInCacheFailureKeyEv
+__ZN7WebCore21DiagnosticLoggingKeys26unhandledRequestFailureKeyEv
+__ZN7WebCore21DiagnosticLoggingKeys29unusableCachedEntryFailureKeyEv
</ins><span class="cx"> __ZN7WebCore21DiagnosticLoggingKeys7userKeyEv
</span><span class="cx"> __ZN7WebCore21DiagnosticLoggingKeys9zoomedKeyEv
</span><span class="cx"> __ZN7WebCore21DisplayRefreshMonitor46handleDisplayRefreshedNotificationOnMainThreadEPv
</span></span></pre></div>
<a id="trunkSourceWebCorepageDiagnosticLoggingKeyscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -103,6 +103,11 @@
</span><span class="cx"> return ASCIILiteral("navigation");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String DiagnosticLoggingKeys::networkCacheKey()
+{
+ return ASCIILiteral("networkCache");
+}
+
</ins><span class="cx"> String DiagnosticLoggingKeys::networkKey()
</span><span class="cx"> {
</span><span class="cx"> return ASCIILiteral("network");
</span><span class="lines">@@ -133,6 +138,11 @@
</span><span class="cx"> return ASCIILiteral("noDocumentLoader");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String DiagnosticLoggingKeys::noLongerInCacheFailureKey()
+{
+ return ASCIILiteral("noLongerInCacheFailure");
+}
+
</ins><span class="cx"> String DiagnosticLoggingKeys::otherKey()
</span><span class="cx"> {
</span><span class="cx"> return ASCIILiteral("other");
</span><span class="lines">@@ -298,6 +308,11 @@
</span><span class="cx"> return ASCIILiteral("resourceResponse");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String DiagnosticLoggingKeys::retrievalKey()
+{
+ return ASCIILiteral("retrieval");
+}
+
</ins><span class="cx"> String DiagnosticLoggingKeys::revalidatingKey()
</span><span class="cx"> {
</span><span class="cx"> return ASCIILiteral("revalidating");
</span><span class="lines">@@ -333,6 +348,16 @@
</span><span class="cx"> return ASCIILiteral("svgDocument");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+String DiagnosticLoggingKeys::unhandledRequestFailureKey()
+{
+ return ASCIILiteral("unhandledRequestFailure");
+}
+
+String DiagnosticLoggingKeys::unusableCachedEntryFailureKey()
+{
+ return ASCIILiteral("unusableCachedEntryFailure");
+}
+
</ins><span class="cx"> String DiagnosticLoggingKeys::unusedKey()
</span><span class="cx"> {
</span><span class="cx"> return ASCIILiteral("unused");
</span></span></pre></div>
<a id="trunkSourceWebCorepageDiagnosticLoggingKeysh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.h        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -63,10 +63,12 @@
</span><span class="cx"> static String mediaLoadingFailedKey();
</span><span class="cx"> static String mustRevalidateIsExpiredKey();
</span><span class="cx"> static String navigationKey();
</span><ins>+ WEBCORE_EXPORT static String networkCacheKey();
</ins><span class="cx"> static String networkKey();
</span><span class="cx"> static String noCacheKey();
</span><span class="cx"> static String noCurrentHistoryItemKey();
</span><span class="cx"> static String noDocumentLoaderKey();
</span><ins>+ WEBCORE_EXPORT static String noLongerInCacheFailureKey();
</ins><span class="cx"> static String noStoreKey();
</span><span class="cx"> static String notInMemoryCacheKey();
</span><span class="cx"> static String otherKey();
</span><span class="lines">@@ -90,12 +92,15 @@
</span><span class="cx"> static String resourceKey();
</span><span class="cx"> static String resourceRequestKey();
</span><span class="cx"> static String resourceResponseKey();
</span><ins>+ WEBCORE_EXPORT static String retrievalKey();
</ins><span class="cx"> static String revalidatingKey();
</span><span class="cx"> static String sameLoadKey();
</span><span class="cx"> static String scriptKey();
</span><span class="cx"> static String sourceKey();
</span><span class="cx"> static String styleSheetKey();
</span><span class="cx"> static String svgDocumentKey();
</span><ins>+ WEBCORE_EXPORT static String unhandledRequestFailureKey();
+ WEBCORE_EXPORT static String unusableCachedEntryFailureKey();
</ins><span class="cx"> static String unusedKey();
</span><span class="cx"> static String unusedReasonCredentialSettingsKey();
</span><span class="cx"> static String unusedReasonErrorKey();
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/ChangeLog        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-02-11 Chris Dumez <cdumez@apple.com>
+
+ [WK2] Add logging to validate the network cache efficacy (Part 2)
+ https://bugs.webkit.org/show_bug.cgi?id=141345
+ <rdar://problem/19632080>
+
+ Reviewed by Sam Weinig.
+
+ Add diagnostic logging messages to validate the network cache efficacy.
+ The following 4 messages are added:
+ - networkCache / retrieval / success
+ - networkCache / retrieval / unhandledRequestFailure
+ - networkCache / retrieval / noLongerInCacheFailure
+ - networkCache / retrieval / unusableCachedEntryFailure
+
+ The messages are sent via IPC from the NetworkProcess to the UIProcess,
+ where the WebPageProxy code already handles diagnostic messages sent by
+ the WebProcess.
+
</ins><span class="cx"> 2015-02-11 Tim Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (iOS 8): PDFs embedded in <object>/<embed> tag don't load at all
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -301,6 +301,21 @@
</span><span class="cx"> parentProcessConnection()->send(Messages::WebProcessPool::DidGetStatistics(data, callbackID), 0);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void NetworkProcess::logDiagnosticMessage(uint64_t webPageID, const String& message, const String& description)
+{
+ parentProcessConnection()->send(Messages::NetworkProcessProxy::LogDiagnosticMessage(webPageID, message, description), 0);
+}
+
+void NetworkProcess::logDiagnosticMessageWithResult(uint64_t webPageID, const String& message, const String& description, WebCore::DiagnosticLoggingResultType result)
+{
+ parentProcessConnection()->send(Messages::NetworkProcessProxy::LogDiagnosticMessageWithResult(webPageID, message, description, result), 0);
+}
+
+void NetworkProcess::logDiagnosticMessageWithValue(uint64_t webPageID, const String& message, const String& description, const String& value)
+{
+ parentProcessConnection()->send(Messages::NetworkProcessProxy::LogDiagnosticMessageWithValue(webPageID, message, description, value), 0);
+}
+
</ins><span class="cx"> void NetworkProcess::terminate()
</span><span class="cx"> {
</span><span class="cx"> platformTerminate();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include "DownloadManager.h"
</span><span class="cx"> #include "MessageReceiverMap.h"
</span><span class="cx"> #include "NetworkResourceLoadScheduler.h"
</span><ins>+#include <WebCore/DiagnosticLoggingResultType.h>
</ins><span class="cx"> #include <WebCore/SessionID.h>
</span><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="lines">@@ -75,6 +76,11 @@
</span><span class="cx"> DownloadManager& downloadManager();
</span><span class="cx"> bool canHandleHTTPSServerTrustEvaluation() const { return m_canHandleHTTPSServerTrustEvaluation; }
</span><span class="cx">
</span><ins>+ // Diagnostic messages logging.
+ void logDiagnosticMessage(uint64_t webPageID, const String& message, const String& description);
+ void logDiagnosticMessageWithResult(uint64_t webPageID, const String& message, const String& description, WebCore::DiagnosticLoggingResultType);
+ void logDiagnosticMessageWithValue(uint64_t webPageID, const String& message, const String& description, const String& value);
+
</ins><span class="cx"> private:
</span><span class="cx"> NetworkProcess();
</span><span class="cx"> ~NetworkProcess();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<NetworkResourceLoader> loader(this);
</span><del>- NetworkCache::singleton().retrieve(originalRequest(), [loader](std::unique_ptr<NetworkCache::Entry> entry) {
</del><ins>+ NetworkCache::singleton().retrieve(originalRequest(), m_parameters.webPageID, [loader](std::unique_ptr<NetworkCache::Entry> entry) {
</ins><span class="cx"> if (loader->hasOneRef()) {
</span><span class="cx"> // The loader has been aborted and is only held alive by this lambda.
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx"> return NetworkCacheKey(request.httpMethod(), partition, request.url().string());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkCache::retrieve(const WebCore::ResourceRequest& originalRequest, std::function<void (std::unique_ptr<Entry>)> completionHandler)
</del><ins>+void NetworkCache::retrieve(const WebCore::ResourceRequest& originalRequest, uint64_t webPageID, std::function<void (std::unique_ptr<Entry>)> completionHandler)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isEnabled());
</span><span class="cx">
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx"> NetworkCacheKey storageKey = makeCacheKey(originalRequest);
</span><span class="cx"> if (!canRetrieve(originalRequest)) {
</span><span class="cx"> if (m_statistics)
</span><del>- m_statistics->recordNotUsingCacheForRequest(storageKey, originalRequest);
</del><ins>+ m_statistics->recordNotUsingCacheForRequest(webPageID, storageKey, originalRequest);
</ins><span class="cx">
</span><span class="cx"> completionHandler(nullptr);
</span><span class="cx"> return;
</span><span class="lines">@@ -236,12 +236,12 @@
</span><span class="cx"> auto startTime = std::chrono::system_clock::now();
</span><span class="cx"> unsigned priority = originalRequest.priority();
</span><span class="cx">
</span><del>- m_storage->retrieve(storageKey, priority, [this, originalRequest, completionHandler, startTime, storageKey](std::unique_ptr<NetworkCacheStorage::Entry> entry) {
</del><ins>+ m_storage->retrieve(storageKey, priority, [this, originalRequest, completionHandler, startTime, storageKey, webPageID](std::unique_ptr<NetworkCacheStorage::Entry> entry) {
</ins><span class="cx"> if (!entry) {
</span><span class="cx"> LOG(NetworkCache, "(NetworkProcess) not found in storage");
</span><span class="cx">
</span><span class="cx"> if (m_statistics)
</span><del>- m_statistics->recordRetrievalFailure(storageKey, originalRequest);
</del><ins>+ m_statistics->recordRetrievalFailure(webPageID, storageKey, originalRequest);
</ins><span class="cx">
</span><span class="cx"> completionHandler(nullptr);
</span><span class="cx"> return false;
</span><span class="lines">@@ -249,7 +249,7 @@
</span><span class="cx"> auto decodedEntry = decodeStorageEntry(*entry, originalRequest);
</span><span class="cx"> bool success = !!decodedEntry;
</span><span class="cx"> if (m_statistics)
</span><del>- m_statistics->recordRetrievedCachedEntry(storageKey, originalRequest, success);
</del><ins>+ m_statistics->recordRetrievedCachedEntry(webPageID, storageKey, originalRequest, success);
</ins><span class="cx">
</span><span class="cx"> #if !LOG_DISABLED
</span><span class="cx"> auto elapsedMS = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - startTime).count();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> bool needsRevalidation;
</span><span class="cx"> };
</span><span class="cx"> // Completion handler may get called back synchronously on failure.
</span><del>- void retrieve(const WebCore::ResourceRequest&, std::function<void (std::unique_ptr<Entry>)>);
</del><ins>+ void retrieve(const WebCore::ResourceRequest&, uint64_t webPageID, std::function<void (std::unique_ptr<Entry>)>);
</ins><span class="cx">
</span><span class="cx"> struct MappedBody {
</span><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStatisticsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.h        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -44,9 +44,9 @@
</span><span class="cx">
</span><span class="cx"> void clear();
</span><span class="cx">
</span><del>- void recordNotUsingCacheForRequest(const NetworkCacheKey&, const WebCore::ResourceRequest&);
- void recordRetrievalFailure(const NetworkCacheKey&, const WebCore::ResourceRequest&);
- void recordRetrievedCachedEntry(const NetworkCacheKey&, const WebCore::ResourceRequest&, bool success);
</del><ins>+ void recordNotUsingCacheForRequest(uint64_t webPageID, const NetworkCacheKey&, const WebCore::ResourceRequest&);
+ void recordRetrievalFailure(uint64_t webPageID, const NetworkCacheKey&, const WebCore::ResourceRequest&);
+ void recordRetrievedCachedEntry(uint64_t webPageID, const NetworkCacheKey&, const WebCore::ResourceRequest&, bool success);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> explicit NetworkCacheStatistics(const String& databasePath);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStatisticsCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -31,6 +31,9 @@
</span><span class="cx"> #include "Logging.h"
</span><span class="cx"> #include "NetworkCache.h"
</span><span class="cx"> #include "NetworkCacheFileSystemPosix.h"
</span><ins>+#include "NetworkProcess.h"
+#include <WebCore/DiagnosticLoggingKeys.h>
+#include <WebCore/DiagnosticLoggingResultType.h>
</ins><span class="cx"> #include <WebCore/ResourceRequest.h>
</span><span class="cx"> #include <WebCore/SQLiteDatabaseTracker.h>
</span><span class="cx"> #include <WebCore/SQLiteStatement.h>
</span><span class="lines">@@ -165,40 +168,42 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkCacheStatistics::recordNotUsingCacheForRequest(const NetworkCacheKey& key, const WebCore::ResourceRequest& request)
</del><ins>+void NetworkCacheStatistics::recordNotUsingCacheForRequest(uint64_t webPageID, const NetworkCacheKey& key, const WebCore::ResourceRequest& request)
</ins><span class="cx"> {
</span><span class="cx"> String hash = key.hashAsString();
</span><span class="cx"> WebCore::URL requestURL = request.url();
</span><del>- queryWasEverRequested(hash, [this, hash, requestURL](bool wasEverRequested) {
</del><ins>+ queryWasEverRequested(hash, [this, hash, requestURL, webPageID](bool wasEverRequested) {
</ins><span class="cx"> if (wasEverRequested) {
</span><del>- LOG(NetworkCache, "(NetworkProcess) %s was previously requested but is not handled by the cache", requestURL.string().ascii().data());
- // FIXME: Do diagnostic logging.
</del><ins>+ LOG(NetworkCache, "(NetworkProcess) webPageID %llu: %s was previously requested but is not handled by the cache", webPageID, requestURL.string().ascii().data());
+ NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::retrievalKey(), WebCore::DiagnosticLoggingKeys::unhandledRequestFailureKey());
</ins><span class="cx"> } else
</span><span class="cx"> markAsRequested(hash);
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkCacheStatistics::recordRetrievalFailure(const NetworkCacheKey& key, const WebCore::ResourceRequest& request)
</del><ins>+void NetworkCacheStatistics::recordRetrievalFailure(uint64_t webPageID, const NetworkCacheKey& key, const WebCore::ResourceRequest& request)
</ins><span class="cx"> {
</span><span class="cx"> String hash = key.hashAsString();
</span><span class="cx"> WebCore::URL requestURL = request.url();
</span><del>- queryWasEverRequested(hash, [this, hash, requestURL](bool wasPreviouslyRequested) {
</del><ins>+ queryWasEverRequested(hash, [this, hash, requestURL, webPageID](bool wasPreviouslyRequested) {
</ins><span class="cx"> if (wasPreviouslyRequested) {
</span><del>- LOG(NetworkCache, "(NetworkProcess) %s was previously cached but is no longer in the cache", requestURL.string().ascii().data());
- // FIXME: Do diagnostic logging.
</del><ins>+ LOG(NetworkCache, "(NetworkProcess) webPageID %llu: %s was previously cached but is no longer in the cache", webPageID, requestURL.string().ascii().data());
+ NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::retrievalKey(), WebCore::DiagnosticLoggingKeys::noLongerInCacheFailureKey());
</ins><span class="cx"> } else
</span><span class="cx"> markAsRequested(hash);
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkCacheStatistics::recordRetrievedCachedEntry(const NetworkCacheKey& key, const WebCore::ResourceRequest& request, bool success)
</del><ins>+void NetworkCacheStatistics::recordRetrievedCachedEntry(uint64_t webPageID, const NetworkCacheKey& key, const WebCore::ResourceRequest& request, bool success)
</ins><span class="cx"> {
</span><span class="cx"> WebCore::URL requestURL = request.url();
</span><del>- if (success)
- LOG(NetworkCache, "(NetworkProcess) %s is in the cache and is used", requestURL.string().ascii().data());
- else
- LOG(NetworkCache, "(NetworkProcess) %s is in the cache but wasn't used", requestURL.string().ascii().data());
- // FIXME: Do diagnostic logging.
</del><ins>+ if (success) {
+ LOG(NetworkCache, "(NetworkProcess) webPageID %llu: %s is in the cache and is used", webPageID, requestURL.string().ascii().data());
+ NetworkProcess::singleton().logDiagnosticMessageWithResult(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::retrievalKey(), WebCore::DiagnosticLoggingResultPass);
+ } else {
+ LOG(NetworkCache, "(NetworkProcess) webPageID %llu: %s is in the cache but wasn't used", webPageID, requestURL.string().ascii().data());
+ NetworkProcess::singleton().logDiagnosticMessageWithValue(webPageID, WebCore::DiagnosticLoggingKeys::networkCacheKey(), WebCore::DiagnosticLoggingKeys::retrievalKey(), WebCore::DiagnosticLoggingKeys::unusableCachedEntryFailureKey());
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NetworkCacheStatistics::markAsRequested(const String& hash)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -230,6 +230,39 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void NetworkProcessProxy::logDiagnosticMessage(uint64_t pageID, const String& message, const String& description)
+{
+ WebPageProxy* page = WebProcessProxy::webPage(pageID);
+ // FIXME: We do this null-check because by the time the decision to log is made, the page may be gone. We should refactor to avoid this,
+ // but for now we simply drop the message in the rare case this happens.
+ if (!page)
+ return;
+
+ page->logDiagnosticMessage(message, description);
+}
+
+void NetworkProcessProxy::logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result)
+{
+ WebPageProxy* page = WebProcessProxy::webPage(pageID);
+ // FIXME: We do this null-check because by the time the decision to log is made, the page may be gone. We should refactor to avoid this,
+ // but for now we simply drop the message in the rare case this happens.
+ if (!page)
+ return;
+
+ page->logDiagnosticMessageWithResult(message, description, result);
+}
+
+void NetworkProcessProxy::logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, const String& value)
+{
+ WebPageProxy* page = WebProcessProxy::webPage(pageID);
+ // FIXME: We do this null-check because by the time the decision to log is made, the page may be gone. We should refactor to avoid this,
+ // but for now we simply drop the message in the rare case this happens.
+ if (!page)
+ return;
+
+ page->logDiagnosticMessageWithValue(message, description, value);
+}
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(NETWORK_PROCESS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkNetworkProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -91,6 +91,9 @@
</span><span class="cx"> void didCreateNetworkConnectionToWebProcess(const IPC::Attachment&);
</span><span class="cx"> void didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
</span><span class="cx"> void didDeleteWebsiteData(uint64_t callbackID);
</span><ins>+ void logDiagnosticMessage(uint64_t pageID, const String& message, const String& description);
+ void logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result);
+ void logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, const String& value);
</ins><span class="cx">
</span><span class="cx"> // ProcessLauncher::Client
</span><span class="cx"> virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkNetworkProcessProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -28,6 +28,11 @@
</span><span class="cx"> DidReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
</span><span class="cx">
</span><span class="cx"> DidDeleteWebsiteData(uint64_t callbackID)
</span><ins>+
+ # Diagnostic messages logging
+ LogDiagnosticMessage(uint64_t pageID, String message, String description)
+ LogDiagnosticMessageWithResult(uint64_t pageID, String message, String description, uint32_t result)
+ LogDiagnosticMessageWithValue(uint64_t pageID, String message, String description, String value)
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(NETWORK_PROCESS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (179971 => 179972)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-02-11 23:40:13 UTC (rev 179971)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-02-11 23:57:31 UTC (rev 179972)
</span><span class="lines">@@ -988,6 +988,11 @@
</span><span class="cx">
</span><span class="cx"> void setShouldDispatchFakeMouseMoveEvents(bool);
</span><span class="cx">
</span><ins>+ // Diagnostic messages logging.
+ void logDiagnosticMessage(const String& message, const String& description);
+ void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result);
+ void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value);
+
</ins><span class="cx"> private:
</span><span class="cx"> WebPageProxy(PageClient&, WebProcessProxy&, uint64_t pageID, const WebPageConfiguration&);
</span><span class="cx"> void platformInitialize();
</span><span class="lines">@@ -1237,11 +1242,6 @@
</span><span class="cx"> void setCursor(const WebCore::Cursor&);
</span><span class="cx"> void setCursorHiddenUntilMouseMoves(bool);
</span><span class="cx">
</span><del>- // Diagnostic messages logging.
- void logDiagnosticMessage(const String& message, const String& description);
- void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result);
- void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value);
-
</del><span class="cx"> void didReceiveEvent(uint32_t opaqueType, bool handled);
</span><span class="cx"> void stopResponsivenessTimer();
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>