<!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>[186756] branches/safari-601.1-branch/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/186756">186756</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-07-12 23:54:36 -0700 (Sun, 12 Jul 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/186707">r186707</a>. rdar://problem/21779205</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6011branchSourceWebCoreChangeLog">branches/safari-601.1-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6011branchSourceWebCorepageDiagnosticLoggingClienth">branches/safari-601.1-branch/Source/WebCore/page/DiagnosticLoggingClient.h</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2ChangeLog">branches/safari-601.1-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2NetworkProcessNetworkProcesscpp">branches/safari-601.1-branch/Source/WebKit2/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessNetworkNetworkProcessProxycpp">branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessNetworkNetworkProcessProxyh">branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessNetworkNetworkProcessProxymessagesin">branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessWebPageProxycpp">branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessWebPageProxyh">branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2UIProcessWebPageProxymessagesin">branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#branchessafari6011branchSourceWebKit2WebProcessWebCoreSupportWebDiagnosticLoggingClientcpp">branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6011branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/ChangeLog (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebCore/ChangeLog        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -1,5 +1,23 @@
</span><span class="cx"> 2015-07-12 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r186707.
+
+ 2015-07-10 Chris Dumez <cdumez@apple.com>
+
+ [WK2] Diagnostic logging messages are causing too much IPC
+ https://bugs.webkit.org/show_bug.cgi?id=146873
+ <rdar://problem/21779205>
+
+ Reviewed by Ryosuke Niwa.
+
+ Move shouldLogAfterSampling() utility function to DiagnosticLoggingClient
+ so it can be easily reused.
+
+ * page/DiagnosticLoggingClient.h:
+ (WebCore::DiagnosticLoggingClient::shouldLogAfterSampling):
+
+2015-07-12 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r186684.
</span><span class="cx">
</span><span class="cx"> 2015-07-10 Zalan Bujtas <zalan@apple.com>
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebCorepageDiagnosticLoggingClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebCore/page/DiagnosticLoggingClient.h (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebCore/page/DiagnosticLoggingClient.h        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebCore/page/DiagnosticLoggingClient.h        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "DiagnosticLoggingResultType.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><ins>+#include <wtf/RandomNumber.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -41,10 +42,21 @@
</span><span class="cx">
</span><span class="cx"> virtual void mainFrameDestroyed() = 0;
</span><span class="cx">
</span><ins>+ static bool shouldLogAfterSampling(ShouldSample);
+
</ins><span class="cx"> protected:
</span><span class="cx"> virtual ~DiagnosticLoggingClient() { }
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+inline bool DiagnosticLoggingClient::shouldLogAfterSampling(ShouldSample shouldSample)
+{
+ if (shouldSample == ShouldSample::No)
+ return true;
+
+ static const double selectionProbability = 0.05;
+ return randomNumber() <= selectionProbability;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/ChangeLog (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/ChangeLog        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/ChangeLog        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -1,5 +1,46 @@
</span><span class="cx"> 2015-07-12 Babak Shafiei <bshafiei@apple.com>
</span><span class="cx">
</span><ins>+ Merge r186707.
+
+ 2015-07-10 Chris Dumez <cdumez@apple.com>
+
+ [WK2] Diagnostic logging messages are causing too much IPC
+ https://bugs.webkit.org/show_bug.cgi?id=146873
+ <rdar://problem/21779205>
+
+ Reviewed by Ryosuke Niwa.
+
+ Diagnostic logging messages are causing too much IPC. To address the
+ problem, we now do the sampling of the senders' side (WebContent
+ process and Networking process) instead of the receiver's side
+ (UIProcess).
+
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::logDiagnosticMessage):
+ (WebKit::NetworkProcess::logDiagnosticMessageWithResult):
+ (WebKit::NetworkProcess::logDiagnosticMessageWithValue):
+ * UIProcess/Network/NetworkProcessProxy.cpp:
+ (WebKit::NetworkProcessProxy::logSampledDiagnosticMessage):
+ (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithResult):
+ (WebKit::NetworkProcessProxy::logSampledDiagnosticMessageWithValue):
+ * UIProcess/Network/NetworkProcessProxy.h:
+ * UIProcess/Network/NetworkProcessProxy.messages.in:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::logDiagnosticMessage):
+ (WebKit::WebPageProxy::logDiagnosticMessageWithResult):
+ (WebKit::WebPageProxy::logDiagnosticMessageWithValue):
+ (WebKit::WebPageProxy::logSampledDiagnosticMessage):
+ (WebKit::WebPageProxy::logSampledDiagnosticMessageWithResult):
+ (WebKit::WebPageProxy::logSampledDiagnosticMessageWithValue):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
+ (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
+ (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
+ (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
+
+2015-07-12 Babak Shafiei <bshafiei@apple.com>
+
</ins><span class="cx"> Merge r186703.
</span><span class="cx">
</span><span class="cx"> 2015-07-10 Dean Jackson <dino@apple.com>
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2NetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #include "WebCookieManager.h"
</span><span class="cx"> #include "WebProcessPoolMessages.h"
</span><span class="cx"> #include "WebsiteData.h"
</span><ins>+#include <WebCore/DiagnosticLoggingClient.h>
</ins><span class="cx"> #include <WebCore/Logging.h>
</span><span class="cx"> #include <WebCore/PlatformCookieJar.h>
</span><span class="cx"> #include <WebCore/ResourceRequest.h>
</span><span class="lines">@@ -478,17 +479,26 @@
</span><span class="cx">
</span><span class="cx"> void NetworkProcess::logDiagnosticMessage(uint64_t webPageID, const String& message, const String& description, WebCore::ShouldSample shouldSample)
</span><span class="cx"> {
</span><del>- parentProcessConnection()->send(Messages::NetworkProcessProxy::LogDiagnosticMessage(webPageID, message, description, shouldSample == ShouldSample::Yes), 0);
</del><ins>+ if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
+ return;
+
+ parentProcessConnection()->send(Messages::NetworkProcessProxy::LogSampledDiagnosticMessage(webPageID, message, description), 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NetworkProcess::logDiagnosticMessageWithResult(uint64_t webPageID, const String& message, const String& description, WebCore::DiagnosticLoggingResultType result, WebCore::ShouldSample shouldSample)
</span><span class="cx"> {
</span><del>- parentProcessConnection()->send(Messages::NetworkProcessProxy::LogDiagnosticMessageWithResult(webPageID, message, description, result, shouldSample == ShouldSample::Yes), 0);
</del><ins>+ if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
+ return;
+
+ parentProcessConnection()->send(Messages::NetworkProcessProxy::LogSampledDiagnosticMessageWithResult(webPageID, message, description, result), 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NetworkProcess::logDiagnosticMessageWithValue(uint64_t webPageID, const String& message, const String& description, const String& value, WebCore::ShouldSample shouldSample)
</span><span class="cx"> {
</span><del>- parentProcessConnection()->send(Messages::NetworkProcessProxy::LogDiagnosticMessageWithValue(webPageID, message, description, value, shouldSample == ShouldSample::Yes), 0);
</del><ins>+ if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
+ return;
+
+ parentProcessConnection()->send(Messages::NetworkProcessProxy::LogSampledDiagnosticMessageWithValue(webPageID, message, description, value), 0);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NetworkProcess::terminate()
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -285,7 +285,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkProcessProxy::logDiagnosticMessage(uint64_t pageID, const String& message, const String& description, bool shouldSample)
</del><ins>+void NetworkProcessProxy::logSampledDiagnosticMessage(uint64_t pageID, const String& message, const String& description)
</ins><span class="cx"> {
</span><span class="cx"> WebPageProxy* page = WebProcessProxy::webPage(pageID);
</span><span class="cx"> // 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,
</span><span class="lines">@@ -293,10 +293,10 @@
</span><span class="cx"> if (!page)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- page->logDiagnosticMessage(message, description, shouldSample);
</del><ins>+ page->logSampledDiagnosticMessage(message, description);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkProcessProxy::logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result, bool shouldSample)
</del><ins>+void NetworkProcessProxy::logSampledDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result)
</ins><span class="cx"> {
</span><span class="cx"> WebPageProxy* page = WebProcessProxy::webPage(pageID);
</span><span class="cx"> // 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,
</span><span class="lines">@@ -304,10 +304,10 @@
</span><span class="cx"> if (!page)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- page->logDiagnosticMessageWithResult(message, description, result, shouldSample);
</del><ins>+ page->logSampledDiagnosticMessageWithResult(message, description, result);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkProcessProxy::logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, const String& value, bool shouldSample)
</del><ins>+void NetworkProcessProxy::logSampledDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, const String& value)
</ins><span class="cx"> {
</span><span class="cx"> WebPageProxy* page = WebProcessProxy::webPage(pageID);
</span><span class="cx"> // 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,
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx"> if (!page)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- page->logDiagnosticMessageWithValue(message, description, value, shouldSample);
</del><ins>+ page->logSampledDiagnosticMessageWithValue(message, description, value);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NetworkProcessProxy::sendProcessWillSuspendImminently()
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessNetworkNetworkProcessProxyh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -109,9 +109,9 @@
</span><span class="cx"> void didFetchWebsiteData(uint64_t callbackID, const WebsiteData&);
</span><span class="cx"> void didDeleteWebsiteData(uint64_t callbackID);
</span><span class="cx"> void didDeleteWebsiteDataForOrigins(uint64_t callbackID);
</span><del>- void logDiagnosticMessage(uint64_t pageID, const String& message, const String& description, bool shouldSample);
- void logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result, bool shouldSample);
- void logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, const String& value, bool shouldSample);
</del><ins>+ void logSampledDiagnosticMessage(uint64_t pageID, const String& message, const String& description);
+ void logSampledDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result);
+ void logSampledDiagnosticMessageWithValue(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="branchessafari6011branchSourceWebKit2UIProcessNetworkNetworkProcessProxymessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.messages.in        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -36,9 +36,9 @@
</span><span class="cx"> SetIsHoldingLockedFiles(bool isHoldingLockedFiles)
</span><span class="cx">
</span><span class="cx"> # Diagnostic messages logging
</span><del>- LogDiagnosticMessage(uint64_t pageID, String message, String description, bool shouldSample)
- LogDiagnosticMessageWithResult(uint64_t pageID, String message, String description, uint32_t result, bool shouldSample)
- LogDiagnosticMessageWithValue(uint64_t pageID, String message, String description, String value, bool shouldSample)
</del><ins>+ LogSampledDiagnosticMessage(uint64_t pageID, String message, String description)
+ LogSampledDiagnosticMessageWithResult(uint64_t pageID, String message, String description, uint32_t result)
+ LogSampledDiagnosticMessageWithValue(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="branchessafari6011branchSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -101,6 +101,7 @@
</span><span class="cx"> #include "WebUserContentControllerProxy.h"
</span><span class="cx"> #include "WebsiteDataStore.h"
</span><span class="cx"> #include <WebCore/BitmapImage.h>
</span><ins>+#include <WebCore/DiagnosticLoggingClient.h>
</ins><span class="cx"> #include <WebCore/DragController.h>
</span><span class="cx"> #include <WebCore/DragData.h>
</span><span class="cx"> #include <WebCore/FloatRect.h>
</span><span class="lines">@@ -114,7 +115,6 @@
</span><span class="cx"> #include <WebCore/WindowFeatures.h>
</span><span class="cx"> #include <stdio.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><del>-#include <wtf/RandomNumber.h>
</del><span class="cx"> #include <wtf/text/StringView.h>
</span><span class="cx">
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><span class="lines">@@ -4717,33 +4717,45 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-static bool shouldLogDiagnosticMessage(bool shouldSample)
</del><ins>+void WebPageProxy::logDiagnosticMessage(const String& message, const String& description, bool shouldSample)
</ins><span class="cx"> {
</span><del>- if (!shouldSample)
- return true;
- // Log 5% of messages when sampling.
- static const double selectionProbability = 0.05;
- return randomNumber() <= selectionProbability;
-}
</del><ins>+ if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample ? ShouldSample::Yes : ShouldSample::No))
+ return;
</ins><span class="cx">
</span><del>-void WebPageProxy::logDiagnosticMessage(const String& message, const String& description, bool shouldSample)
-{
- if (shouldLogDiagnosticMessage(shouldSample))
- m_diagnosticLoggingClient->logDiagnosticMessage(this, message, description);
</del><ins>+ logSampledDiagnosticMessage(message, description);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, bool shouldSample)
</span><span class="cx"> {
</span><del>- if (shouldLogDiagnosticMessage(shouldSample))
- m_diagnosticLoggingClient->logDiagnosticMessageWithResult(this, message, description, static_cast<WebCore::DiagnosticLoggingResultType>(result));
</del><ins>+ if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample ? ShouldSample::Yes : ShouldSample::No))
+ return;
+
+ logSampledDiagnosticMessageWithResult(message, description, static_cast<WebCore::DiagnosticLoggingResultType>(result));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebPageProxy::logDiagnosticMessageWithValue(const String& message, const String& description, const String& value, bool shouldSample)
</span><span class="cx"> {
</span><del>- if (shouldLogDiagnosticMessage(shouldSample))
- m_diagnosticLoggingClient->logDiagnosticMessageWithValue(this, message, description, value);
</del><ins>+ if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample ? ShouldSample::Yes : ShouldSample::No))
+ return;
+
+ logSampledDiagnosticMessageWithValue(message, description, value);
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+void WebPageProxy::logSampledDiagnosticMessage(const String& message, const String& description)
+{
+ m_diagnosticLoggingClient->logDiagnosticMessage(this, message, description);
+}
+
+void WebPageProxy::logSampledDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result)
+{
+ m_diagnosticLoggingClient->logDiagnosticMessageWithResult(this, message, description, static_cast<WebCore::DiagnosticLoggingResultType>(result));
+}
+
+void WebPageProxy::logSampledDiagnosticMessageWithValue(const String& message, const String& description, const String& value)
+{
+ m_diagnosticLoggingClient->logDiagnosticMessageWithValue(this, message, description, value);
+}
+
</ins><span class="cx"> void WebPageProxy::rectForCharacterRangeCallback(const IntRect& rect, const EditingRange& actualRange, uint64_t callbackID)
</span><span class="cx"> {
</span><span class="cx"> MESSAGE_CHECK(actualRange.isValid());
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -1060,6 +1060,9 @@
</span><span class="cx"> void logDiagnosticMessage(const String& message, const String& description, bool shouldSample);
</span><span class="cx"> void logDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result, bool shouldSample);
</span><span class="cx"> void logDiagnosticMessageWithValue(const String& message, const String& description, const String& value, bool shouldSample);
</span><ins>+ void logSampledDiagnosticMessage(const String& message, const String& description);
+ void logSampledDiagnosticMessageWithResult(const String& message, const String& description, uint32_t result);
+ void logSampledDiagnosticMessageWithValue(const String& message, const String& description, const String& value);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
</span><span class="cx"> void addPlaybackTargetPickerClient(uint64_t);
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -226,9 +226,9 @@
</span><span class="cx"> ExecuteUndoRedo(uint32_t action) -> (bool result)
</span><span class="cx">
</span><span class="cx"> # Diagnostic messages logging
</span><del>- LogDiagnosticMessage(String message, String description, bool shouldSample)
- LogDiagnosticMessageWithResult(String message, String description, uint32_t result, bool shouldSample)
- LogDiagnosticMessageWithValue(String message, String description, String value, bool shouldSample)
</del><ins>+ LogSampledDiagnosticMessage(String message, String description)
+ LogSampledDiagnosticMessageWithResult(String message, String description, uint32_t result)
+ LogSampledDiagnosticMessageWithValue(String message, String description, String value)
</ins><span class="cx">
</span><span class="cx"> # Editor notifications
</span><span class="cx"> EditorStateChanged(struct WebKit::EditorState editorState)
</span></span></pre></div>
<a id="branchessafari6011branchSourceWebKit2WebProcessWebCoreSupportWebDiagnosticLoggingClientcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp (186755 => 186756)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp        2015-07-13 06:52:30 UTC (rev 186755)
+++ branches/safari-601.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp        2015-07-13 06:54:36 UTC (rev 186756)
</span><span class="lines">@@ -43,32 +43,38 @@
</span><span class="cx">
</span><span class="cx"> void WebDiagnosticLoggingClient::logDiagnosticMessage(const String& message, const String& description, WebCore::ShouldSample shouldSample)
</span><span class="cx"> {
</span><del>- if (!m_page.corePage() || !m_page.corePage()->settings().diagnosticLoggingEnabled())
</del><ins>+ ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled());
+
+ if (!shouldLogAfterSampling(shouldSample))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // FIXME: Remove this injected bundle API.
</span><span class="cx"> m_page.injectedBundleDiagnosticLoggingClient().logDiagnosticMessage(&m_page, message, description);
</span><del>- m_page.send(Messages::WebPageProxy::LogDiagnosticMessage(message, description, shouldSample == WebCore::ShouldSample::Yes));
</del><ins>+ m_page.send(Messages::WebPageProxy::LogSampledDiagnosticMessage(message, description));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebDiagnosticLoggingClient::logDiagnosticMessageWithResult(const String& message, const String& description, WebCore::DiagnosticLoggingResultType result, WebCore::ShouldSample shouldSample)
</span><span class="cx"> {
</span><del>- if (!m_page.corePage() || !m_page.corePage()->settings().diagnosticLoggingEnabled())
</del><ins>+ ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled());
+
+ if (!shouldLogAfterSampling(shouldSample))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // FIXME: Remove this injected bundle API.
</span><span class="cx"> m_page.injectedBundleDiagnosticLoggingClient().logDiagnosticMessageWithResult(&m_page, message, description, result);
</span><del>- m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithResult(message, description, result, shouldSample == WebCore::ShouldSample::Yes));
</del><ins>+ m_page.send(Messages::WebPageProxy::LogSampledDiagnosticMessageWithResult(message, description, result));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebDiagnosticLoggingClient::logDiagnosticMessageWithValue(const String& message, const String& description, const String& value, WebCore::ShouldSample shouldSample)
</span><span class="cx"> {
</span><del>- if (!m_page.corePage() || !m_page.corePage()->settings().diagnosticLoggingEnabled())
</del><ins>+ ASSERT(!m_page.corePage() || m_page.corePage()->settings().diagnosticLoggingEnabled());
+
+ if (!shouldLogAfterSampling(shouldSample))
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // FIXME: Remove this injected bundle API.
</span><span class="cx"> m_page.injectedBundleDiagnosticLoggingClient().logDiagnosticMessageWithValue(&m_page, message, description, value);
</span><del>- m_page.send(Messages::WebPageProxy::LogDiagnosticMessageWithValue(message, description, value, shouldSample == WebCore::ShouldSample::Yes));
</del><ins>+ m_page.send(Messages::WebPageProxy::LogSampledDiagnosticMessageWithValue(message, description, value));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebDiagnosticLoggingClient::mainFrameDestroyed()
</span></span></pre>
</div>
</div>
</body>
</html>