<!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>[199955] 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/199955">199955</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-04-23 14:33:49 -0700 (Sat, 23 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Tie the DiagnosticLoggingClient's lifetime to the Page
https://bugs.webkit.org/show_bug.cgi?id=156938
&lt;rdar://problem/25851499&gt;

Reviewed by Antti Koivisto.

Source/WebCore:

Tie the DiagnosticLoggingClient's lifetime to the Page rather than to the
MainFrame. The diagnostic logging client in WebKit2 requires the WebPage
to be alive in order to send IPC to the UIProcess. The WebPage owns the
Page and Page is not refCounted so the lifetime of the
DiagnosticLoggingClient should now be tied to the one of the WebPage as
well.

Previously, the DiagnosticLoggingClient would stay alive as long as the
MainFrame and could apparently in rare cases outlive the WebPage, thus
crashing when trying to send the IPC.

* history/PageCache.cpp:
(WebCore::logPageCacheFailureDiagnosticMessage):
(WebCore::canCachePage):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
(WebCore::logMediaLoadRequest):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::logNavigation):
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/ResourceLoader.cpp:
(WebCore::logResourceResponseSource):
* loader/SubframeLoader.cpp:
(WebCore::logPluginRequest):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::logResourceLoaded):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::logMemoryCacheResourceRequest):
(WebCore::logResourceRevalidationDecision):
* page/DiagnosticLoggingClient.h:
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame): Deleted.
(WebCore::MainFrame::~MainFrame): Deleted.
(WebCore::MainFrame::diagnosticLoggingClient): Deleted.
* page/MainFrame.h:
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::~Page):
(WebCore::Page::diagnosticLoggingClient):
* page/Page.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
(WebKit::WebDiagnosticLoggingClient::pageDestroyed):
(WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed): Deleted.
* WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::willStartUserTriggeredZooming):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorehistoryPageCachecpp">trunk/Source/WebCore/history/PageCache.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientscpp">trunk/Source/WebCore/loader/EmptyClients.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubframeLoadercpp">trunk/Source/WebCore/loader/SubframeLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubresourceLoadercpp">trunk/Source/WebCore/loader/SubresourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDiagnosticLoggingClienth">trunk/Source/WebCore/page/DiagnosticLoggingClient.h</a></li>
<li><a href="#trunkSourceWebCorepageMainFramecpp">trunk/Source/WebCore/page/MainFrame.cpp</a></li>
<li><a href="#trunkSourceWebCorepageMainFrameh">trunk/Source/WebCore/page/MainFrame.h</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationcpp">trunk/Source/WebCore/page/PageConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationh">trunk/Source/WebCore/page/PageConfiguration.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebDiagnosticLoggingClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebDiagnosticLoggingClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/ChangeLog        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -1,3 +1,58 @@
</span><ins>+2016-04-23  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Tie the DiagnosticLoggingClient's lifetime to the Page
+        https://bugs.webkit.org/show_bug.cgi?id=156938
+        &lt;rdar://problem/25851499&gt;
+
+        Reviewed by Antti Koivisto.
+
+        Tie the DiagnosticLoggingClient's lifetime to the Page rather than to the
+        MainFrame. The diagnostic logging client in WebKit2 requires the WebPage
+        to be alive in order to send IPC to the UIProcess. The WebPage owns the
+        Page and Page is not refCounted so the lifetime of the
+        DiagnosticLoggingClient should now be tied to the one of the WebPage as
+        well.
+
+        Previously, the DiagnosticLoggingClient would stay alive as long as the
+        MainFrame and could apparently in rare cases outlive the WebPage, thus
+        crashing when trying to send the IPC.
+
+        * history/PageCache.cpp:
+        (WebCore::logPageCacheFailureDiagnosticMessage):
+        (WebCore::canCachePage):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::loadResource):
+        (WebCore::logMediaLoadRequest):
+        (WebCore::HTMLMediaElement::updatePlayState):
+        (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
+        * loader/EmptyClients.h:
+        * loader/FrameLoader.cpp:
+        (WebCore::logNavigation):
+        (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+        (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
+        * loader/ResourceLoader.cpp:
+        (WebCore::logResourceResponseSource):
+        * loader/SubframeLoader.cpp:
+        (WebCore::logPluginRequest):
+        * loader/SubresourceLoader.cpp:
+        (WebCore::SubresourceLoader::willSendRequestInternal):
+        (WebCore::SubresourceLoader::didReceiveResponse):
+        (WebCore::logResourceLoaded):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::logMemoryCacheResourceRequest):
+        (WebCore::logResourceRevalidationDecision):
+        * page/DiagnosticLoggingClient.h:
+        * page/MainFrame.cpp:
+        (WebCore::MainFrame::MainFrame): Deleted.
+        (WebCore::MainFrame::~MainFrame): Deleted.
+        (WebCore::MainFrame::diagnosticLoggingClient): Deleted.
+        * page/MainFrame.h:
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        (WebCore::Page::~Page):
+        (WebCore::Page::diagnosticLoggingClient):
+        * page/Page.h:
+
</ins><span class="cx"> 2016-04-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Cannot access the SQLTransaction.constructor.prototype
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryPageCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/PageCache.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/PageCache.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/history/PageCache.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    logPageCacheFailureDiagnosticMessage(page-&gt;mainFrame().diagnosticLoggingClient(), reason);
</del><ins>+    logPageCacheFailureDiagnosticMessage(page-&gt;diagnosticLoggingClient(), reason);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static bool canCacheFrame(Frame&amp; frame, DiagnosticLoggingClient&amp; diagnosticLoggingClient, unsigned indentLevel)
</span><span class="lines">@@ -190,11 +190,10 @@
</span><span class="cx"> {
</span><span class="cx">     unsigned indentLevel = 0;
</span><span class="cx">     PCLOG(&quot;--------\n Determining if page can be cached:&quot;);
</span><ins>+
+    DiagnosticLoggingClient&amp; diagnosticLoggingClient = page.diagnosticLoggingClient();
+    bool isCacheable = canCacheFrame(page.mainFrame(), diagnosticLoggingClient, indentLevel + 1);
</ins><span class="cx">     
</span><del>-    MainFrame&amp; mainFrame = page.mainFrame();
-    DiagnosticLoggingClient&amp; diagnosticLoggingClient = mainFrame.diagnosticLoggingClient();
-    bool isCacheable = canCacheFrame(mainFrame, diagnosticLoggingClient, indentLevel + 1);
-    
</del><span class="cx">     if (!page.settings().usesPageCache() || page.isResourceCachingDisabled()) {
</span><span class="cx">         PCLOG(&quot;   -Page settings says b/f cache disabled&quot;);
</span><span class="cx">         logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::isDisabledKey());
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -1317,8 +1317,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Log that we started loading a media element.
</span><del>-    if (Frame* frame = document().frame())
-        frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::mediaKey(), isVideo() ? DiagnosticLoggingKeys::videoKey() : DiagnosticLoggingKeys::audioKey(), DiagnosticLoggingKeys::loadingKey(), ShouldSample::No);
</del><ins>+    page-&gt;diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::mediaKey(), isVideo() ? DiagnosticLoggingKeys::videoKey() : DiagnosticLoggingKeys::audioKey(), DiagnosticLoggingKeys::loadingKey(), ShouldSample::No);
</ins><span class="cx"> 
</span><span class="cx">     m_firstTimePlaying = true;
</span><span class="cx"> 
</span><span class="lines">@@ -1987,7 +1986,7 @@
</span><span class="cx">     if (!page)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    DiagnosticLoggingClient&amp; diagnosticLoggingClient = page-&gt;mainFrame().diagnosticLoggingClient();
</del><ins>+    DiagnosticLoggingClient&amp; diagnosticLoggingClient = page-&gt;diagnosticLoggingClient();
</ins><span class="cx">     if (!succeeded) {
</span><span class="cx">         diagnosticLoggingClient.logDiagnosticMessageWithResult(DiagnosticLoggingKeys::mediaLoadingFailedKey(), errorMessage, DiagnosticLoggingResultFail, ShouldSample::No);
</span><span class="cx">         return;
</span><span class="lines">@@ -4845,8 +4844,8 @@
</span><span class="cx"> 
</span><span class="cx">             if (m_firstTimePlaying) {
</span><span class="cx">                 // Log that a media element was played.
</span><del>-                if (Frame* frame = document().frame())
-                    frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::mediaKey(), isVideo() ? DiagnosticLoggingKeys::videoKey() : DiagnosticLoggingKeys::audioKey(), DiagnosticLoggingKeys::playedKey(), ShouldSample::No);
</del><ins>+                if (auto* page = document().page())
+                    page-&gt;diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::mediaKey(), isVideo() ? DiagnosticLoggingKeys::videoKey() : DiagnosticLoggingKeys::audioKey(), DiagnosticLoggingKeys::playedKey(), ShouldSample::No);
</ins><span class="cx">                 m_firstTimePlaying = false;
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="lines">@@ -6296,8 +6295,8 @@
</span><span class="cx">     if (!m_player)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (Frame* frame = document().frame())
-        frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::engineFailedToLoadKey(), m_player-&gt;engineDescription(), String::number(m_player-&gt;platformErrorCode()), ShouldSample::No);
</del><ins>+    if (auto* page = document().page())
+        page-&gt;diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::engineFailedToLoadKey(), m_player-&gt;engineDescription(), String::number(m_player-&gt;platformErrorCode()), ShouldSample::No);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double HTMLMediaElement::mediaPlayerRequestedPlaybackRate() const
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -141,8 +141,7 @@
</span><span class="cx">     static NeverDestroyed&lt;EmptyProgressTrackerClient&gt; dummyProgressTrackerClient;
</span><span class="cx">     pageConfiguration.progressTrackerClient = &amp;dummyProgressTrackerClient.get();
</span><span class="cx"> 
</span><del>-    static NeverDestroyed&lt;EmptyDiagnosticLoggingClient&gt; dummyDiagnosticLoggingClient;
-    pageConfiguration.diagnosticLoggingClient = &amp;dummyDiagnosticLoggingClient.get();
</del><ins>+    pageConfiguration.diagnosticLoggingClient = std::make_unique&lt;EmptyDiagnosticLoggingClient&gt;();
</ins><span class="cx"> 
</span><span class="cx">     pageConfiguration.applicationCacheStorage = ApplicationCacheStorage::create(String(), String());
</span><span class="cx">     pageConfiguration.databaseProvider = adoptRef(new EmptyDatabaseProvider);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/loader/EmptyClients.h        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -640,8 +640,6 @@
</span><span class="cx">     void logDiagnosticMessage(const String&amp;, const String&amp;, ShouldSample) override { }
</span><span class="cx">     void logDiagnosticMessageWithResult(const String&amp;, const String&amp;, DiagnosticLoggingResultType, ShouldSample) override { }
</span><span class="cx">     void logDiagnosticMessageWithValue(const String&amp;, const String&amp;, const String&amp;, ShouldSample) override { }
</span><del>-
-    void mainFrameDestroyed() override { }
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> void fillWithEmptyClients(PageConfiguration&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -1365,6 +1365,9 @@
</span><span class="cx"> 
</span><span class="cx"> static void logNavigation(MainFrame&amp; frame, FrameLoadType type)
</span><span class="cx"> {
</span><ins>+    if (!frame.page())
+        return;
+
</ins><span class="cx">     String navigationDescription;
</span><span class="cx">     switch (type) {
</span><span class="cx">     case FrameLoadType::Standard:
</span><span class="lines">@@ -1393,7 +1396,7 @@
</span><span class="cx">         // Not logging those for now.
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    frame.diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::navigationKey(), navigationDescription, ShouldSample::No);
</del><ins>+    frame.page()-&gt;diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::navigationKey(), navigationDescription, ShouldSample::No);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void FrameLoader::loadWithDocumentLoader(DocumentLoader* loader, FrameLoadType type, PassRefPtr&lt;FormState&gt; prpFormState, AllowNavigationToInvalidURL allowNavigationToInvalidURL)
</span><span class="lines">@@ -2325,7 +2328,7 @@
</span><span class="cx">             // Don't assume 'page' is still available to use.
</span><span class="cx">             if (m_frame.isMainFrame() &amp;&amp; m_frame.page()) {
</span><span class="cx">                 ASSERT(&amp;m_frame.page()-&gt;mainFrame() == &amp;m_frame);
</span><del>-                m_frame.page()-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::pageLoadedKey(), emptyString(), error.isNull() ? DiagnosticLoggingResultPass : DiagnosticLoggingResultFail, ShouldSample::Yes);
</del><ins>+                m_frame.page()-&gt;diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::pageLoadedKey(), emptyString(), error.isNull() ? DiagnosticLoggingResultPass : DiagnosticLoggingResultFail, ShouldSample::Yes);
</ins><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             return;
</span><span class="lines">@@ -3049,7 +3052,7 @@
</span><span class="cx">     setPolicyDocumentLoader(nullptr);
</span><span class="cx"> 
</span><span class="cx">     if (isBackForwardLoadType(type)) {
</span><del>-        auto&amp; diagnosticLoggingClient = m_frame.mainFrame().diagnosticLoggingClient();
</del><ins>+        auto&amp; diagnosticLoggingClient = m_frame.page()-&gt;diagnosticLoggingClient();
</ins><span class="cx">         if (history().provisionalItem()-&gt;isInPageCache()) {
</span><span class="cx">             diagnosticLoggingClient.logDiagnosticMessageWithResult(DiagnosticLoggingKeys::pageCacheKey(), DiagnosticLoggingKeys::retrievalKey(), DiagnosticLoggingResultPass, ShouldSample::Yes);
</span><span class="cx">             loadProvisionalItemFromCachedPage();
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -403,7 +403,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void logResourceResponseSource(Frame* frame, ResourceResponse::Source source)
</span><span class="cx"> {
</span><del>-    if (!frame)
</del><ins>+    if (!frame || !frame-&gt;page())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     String sourceKey;
</span><span class="lines">@@ -423,7 +423,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceResponseKey(), DiagnosticLoggingKeys::sourceKey(), sourceKey, ShouldSample::Yes);
</del><ins>+    frame-&gt;page()-&gt;diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceResponseKey(), DiagnosticLoggingKeys::sourceKey(), sourceKey, ShouldSample::Yes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ResourceLoader::didReceiveResponse(const ResourceResponse&amp; r)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubframeLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubframeLoader.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubframeLoader.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/loader/SubframeLoader.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -209,7 +209,7 @@
</span><span class="cx">     String pluginFile = page-&gt;pluginData().pluginFileForWebVisibleMimeType(newMIMEType);
</span><span class="cx">     String description = !pluginFile ? newMIMEType : pluginFile;
</span><span class="cx"> 
</span><del>-    DiagnosticLoggingClient&amp; diagnosticLoggingClient = page-&gt;mainFrame().diagnosticLoggingClient();
</del><ins>+    DiagnosticLoggingClient&amp; diagnosticLoggingClient = page-&gt;diagnosticLoggingClient();
</ins><span class="cx">     diagnosticLoggingClient.logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), description, ShouldSample::No);
</span><span class="cx"> 
</span><span class="cx">     if (!page-&gt;hasSeenAnyPlugin())
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubresourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -182,8 +182,8 @@
</span><span class="cx">         if (newRequest.isConditional() &amp;&amp; m_resource-&gt;resourceToRevalidate() &amp;&amp; newRequest.url() != m_resource-&gt;resourceToRevalidate()-&gt;response().url()) {
</span><span class="cx">             newRequest.makeUnconditional();
</span><span class="cx">             MemoryCache::singleton().revalidationFailed(*m_resource);
</span><del>-            if (m_frame)
-                m_frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail, ShouldSample::Yes);
</del><ins>+            if (m_frame &amp;&amp; m_frame-&gt;page())
+                m_frame-&gt;page()-&gt;diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail, ShouldSample::Yes);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         if (!m_documentLoader-&gt;cachedResourceLoader().canRequest(m_resource-&gt;type(), newRequest.url(), options(), false /* forPreload */, true /* didReceiveRedirectResponse */)) {
</span><span class="lines">@@ -246,16 +246,16 @@
</span><span class="cx">             // Existing resource is ok, just use it updating the expiration time.
</span><span class="cx">             m_resource-&gt;setResponse(response);
</span><span class="cx">             MemoryCache::singleton().revalidationSucceeded(*m_resource, response);
</span><del>-            if (m_frame)
-                m_frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultPass, ShouldSample::Yes);
</del><ins>+            if (m_frame &amp;&amp; m_frame-&gt;page())
+                m_frame-&gt;page()-&gt;diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultPass, ShouldSample::Yes);
</ins><span class="cx">             if (!reachedTerminalState())
</span><span class="cx">                 ResourceLoader::didReceiveResponse(response);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         // Did not get 304 response, continue as a regular resource load.
</span><span class="cx">         MemoryCache::singleton().revalidationFailed(*m_resource);
</span><del>-        if (m_frame)
-            m_frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail, ShouldSample::Yes);
</del><ins>+        if (m_frame &amp;&amp; m_frame-&gt;page())
+            m_frame-&gt;page()-&gt;diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail, ShouldSample::Yes);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_resource-&gt;responseReceived(response);
</span><span class="lines">@@ -338,7 +338,7 @@
</span><span class="cx"> 
</span><span class="cx"> static void logResourceLoaded(Frame* frame, CachedResource::Type type)
</span><span class="cx"> {
</span><del>-    if (!frame)
</del><ins>+    if (!frame || !frame-&gt;page())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     String resourceType;
</span><span class="lines">@@ -382,7 +382,7 @@
</span><span class="cx">         resourceType = DiagnosticLoggingKeys::otherKey();
</span><span class="cx">         break;
</span><span class="cx">     }
</span><del>-    frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceKey(), DiagnosticLoggingKeys::loadedKey(), resourceType, ShouldSample::Yes);
</del><ins>+    frame-&gt;page()-&gt;diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceKey(), DiagnosticLoggingKeys::loadedKey(), resourceType, ShouldSample::Yes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool SubresourceLoader::checkCrossOriginAccessControl(const ResourceRequest&amp; previousRequest, const ResourceResponse&amp; redirectResponse, ResourceRequest&amp; newRequest)
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -539,12 +539,12 @@
</span><span class="cx"> 
</span><span class="cx"> static inline void logMemoryCacheResourceRequest(Frame* frame, const String&amp; description, const String&amp; value = String())
</span><span class="cx"> {
</span><del>-    if (!frame)
</del><ins>+    if (!frame || !frame-&gt;page())
</ins><span class="cx">         return;
</span><span class="cx">     if (value.isNull())
</span><del>-        frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceRequestKey(), description, ShouldSample::Yes);
</del><ins>+        frame-&gt;page()-&gt;diagnosticLoggingClient().logDiagnosticMessage(DiagnosticLoggingKeys::resourceRequestKey(), description, ShouldSample::Yes);
</ins><span class="cx">     else
</span><del>-        frame-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceRequestKey(), description, value, ShouldSample::Yes);
</del><ins>+        frame-&gt;page()-&gt;diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::resourceRequestKey(), description, value, ShouldSample::Yes);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CachedResourceHandle&lt;CachedResource&gt; CachedResourceLoader::requestResource(CachedResource::Type type, CachedResourceRequest&amp; request)
</span><span class="lines">@@ -719,9 +719,9 @@
</span><span class="cx"> 
</span><span class="cx"> static void logResourceRevalidationDecision(CachedResource::RevalidationDecision reason, const Frame* frame)
</span><span class="cx"> {
</span><del>-    if (!frame)
</del><ins>+    if (!frame || !frame-&gt;page())
</ins><span class="cx">         return;
</span><del>-    auto&amp; logClient = frame-&gt;mainFrame().diagnosticLoggingClient();
</del><ins>+    auto&amp; logClient = frame-&gt;page()-&gt;diagnosticLoggingClient();
</ins><span class="cx">     switch (reason) {
</span><span class="cx">     case CachedResource::RevalidationDecision::No:
</span><span class="cx">         break;
</span></span></pre></div>
<a id="trunkSourceWebCorepageDiagnosticLoggingClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DiagnosticLoggingClient.h (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DiagnosticLoggingClient.h        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/page/DiagnosticLoggingClient.h        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #define DiagnosticLoggingClient_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DiagnosticLoggingResultType.h&quot;
</span><ins>+#include &lt;wtf/FastMalloc.h&gt;
</ins><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/RandomNumber.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -35,16 +36,14 @@
</span><span class="cx"> enum class ShouldSample { No, Yes };
</span><span class="cx"> 
</span><span class="cx"> class DiagnosticLoggingClient {
</span><ins>+    WTF_MAKE_FAST_ALLOCATED;
</ins><span class="cx"> public:
</span><span class="cx">     virtual void logDiagnosticMessage(const String&amp; message, const String&amp; description, ShouldSample) = 0;
</span><span class="cx">     virtual void logDiagnosticMessageWithResult(const String&amp; message, const String&amp; description, DiagnosticLoggingResultType, ShouldSample) = 0;
</span><span class="cx">     virtual void logDiagnosticMessageWithValue(const String&amp; message, const String&amp; description, const String&amp; value, ShouldSample) = 0;
</span><span class="cx"> 
</span><del>-    virtual void mainFrameDestroyed() = 0;
-
</del><span class="cx">     static bool shouldLogAfterSampling(ShouldSample);
</span><span class="cx"> 
</span><del>-protected:
</del><span class="cx">     virtual ~DiagnosticLoggingClient() { }
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageMainFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MainFrame.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MainFrame.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/page/MainFrame.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> #endif
</span><span class="cx">     , m_recentWheelEventDeltaFilter(WheelEventDeltaFilter::create())
</span><span class="cx">     , m_pageOverlayController(std::make_unique&lt;PageOverlayController&gt;(*this))
</span><del>-    , m_diagnosticLoggingClient(configuration.diagnosticLoggingClient)
</del><span class="cx"> {
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> #include &lt;WebKitAdditions/MainFrameInitialization.cpp&gt;
</span><span class="lines">@@ -64,9 +63,6 @@
</span><span class="cx"> 
</span><span class="cx"> MainFrame::~MainFrame()
</span><span class="cx"> {
</span><del>-    if (m_diagnosticLoggingClient)
-        m_diagnosticLoggingClient-&gt;mainFrameDestroyed();
-
</del><span class="cx">     m_recentWheelEventDeltaFilter = nullptr;
</span><span class="cx">     m_eventHandler = nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -98,15 +94,6 @@
</span><span class="cx">     deref();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-DiagnosticLoggingClient&amp; MainFrame::diagnosticLoggingClient() const
-{
-    static NeverDestroyed&lt;EmptyDiagnosticLoggingClient&gt; dummyClient;
-    if (!settings().diagnosticLoggingEnabled() || !m_diagnosticLoggingClient)
-        return dummyClient;
-
-    return *m_diagnosticLoggingClient;
-}
-
</del><span class="cx"> void MainFrame::dropChildren()
</span><span class="cx"> {
</span><span class="cx">     while (Frame* child = tree().firstChild())
</span></span></pre></div>
<a id="trunkSourceWebCorepageMainFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MainFrame.h (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MainFrame.h        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/page/MainFrame.h        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class DiagnosticLoggingClient;
</del><span class="cx"> class PageConfiguration;
</span><span class="cx"> class PageOverlayController;
</span><span class="cx"> class ScrollLatchingState;
</span><span class="lines">@@ -67,8 +66,6 @@
</span><span class="cx">     void removeLatchingStateForTarget(Element&amp;);
</span><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT DiagnosticLoggingClient&amp; diagnosticLoggingClient() const;
-
</del><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> #include &lt;WebKitAdditions/MainFrameMembers.h&gt;
</span><span class="cx"> #endif
</span><span class="lines">@@ -89,7 +86,6 @@
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;WheelEventDeltaFilter&gt; m_recentWheelEventDeltaFilter;
</span><span class="cx">     std::unique_ptr&lt;PageOverlayController&gt; m_pageOverlayController;
</span><del>-    DiagnosticLoggingClient* m_diagnosticLoggingClient;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline bool Frame::isMainFrame() const
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/page/Page.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -31,11 +31,13 @@
</span><span class="cx"> #include &quot;ContextMenuClient.h&quot;
</span><span class="cx"> #include &quot;ContextMenuController.h&quot;
</span><span class="cx"> #include &quot;DatabaseProvider.h&quot;
</span><ins>+#include &quot;DiagnosticLoggingClient.h&quot;
</ins><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><span class="cx"> #include &quot;DocumentMarkerController.h&quot;
</span><span class="cx"> #include &quot;DragController.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;EditorClient.h&quot;
</span><ins>+#include &quot;EmptyClients.h&quot;
</ins><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="lines">@@ -181,6 +183,7 @@
</span><span class="cx">     , m_editorClient(*pageConfiguration.editorClient)
</span><span class="cx">     , m_plugInClient(pageConfiguration.plugInClient)
</span><span class="cx">     , m_validationMessageClient(pageConfiguration.validationMessageClient)
</span><ins>+    , m_diagnosticLoggingClient(WTFMove(pageConfiguration.diagnosticLoggingClient))
</ins><span class="cx">     , m_subframeCount(0)
</span><span class="cx">     , m_openedByDOM(false)
</span><span class="cx">     , m_tabKeyCyclesThroughElements(true)
</span><span class="lines">@@ -267,6 +270,7 @@
</span><span class="cx"> 
</span><span class="cx"> Page::~Page()
</span><span class="cx"> {
</span><ins>+    m_diagnosticLoggingClient = nullptr;
</ins><span class="cx">     m_mainFrame-&gt;setView(nullptr);
</span><span class="cx">     setGroupName(String());
</span><span class="cx">     allPages-&gt;remove(this);
</span><span class="lines">@@ -760,6 +764,15 @@
</span><span class="cx">     m_inLowQualityInterpolationMode = mode;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+DiagnosticLoggingClient&amp; Page::diagnosticLoggingClient() const
+{
+    static NeverDestroyed&lt;EmptyDiagnosticLoggingClient&gt; dummyClient;
+    if (!settings().diagnosticLoggingEnabled() || !m_diagnosticLoggingClient)
+        return dummyClient;
+
+    return *m_diagnosticLoggingClient;
+}
+
</ins><span class="cx"> void Page::setMediaVolume(float volume)
</span><span class="cx"> {
</span><span class="cx">     if (volume &lt; 0 || volume &gt; 1)
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/page/Page.h        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx"> class ContextMenuClient;
</span><span class="cx"> class ContextMenuController;
</span><span class="cx"> class DatabaseProvider;
</span><ins>+class DiagnosticLoggingClient;
</ins><span class="cx"> class DragCaretController;
</span><span class="cx"> class DragClient;
</span><span class="cx"> class DragController;
</span><span class="lines">@@ -328,6 +329,8 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT unsigned pageCount() const;
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT DiagnosticLoggingClient&amp; diagnosticLoggingClient() const;
+
</ins><span class="cx">     // Notifications when the Page starts and stops being presented via a native window.
</span><span class="cx">     WEBCORE_EXPORT void setViewState(ViewState::Flags);
</span><span class="cx">     void setPageActivityState(PageActivityState::Flags);
</span><span class="lines">@@ -584,6 +587,7 @@
</span><span class="cx">     EditorClient&amp; m_editorClient;
</span><span class="cx">     PlugInClient* m_plugInClient;
</span><span class="cx">     ValidationMessageClient* m_validationMessageClient;
</span><ins>+    std::unique_ptr&lt;DiagnosticLoggingClient&gt; m_diagnosticLoggingClient;
</ins><span class="cx"> 
</span><span class="cx">     int m_subframeCount;
</span><span class="cx">     String m_groupName;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;ApplicationCacheStorage.h&quot;
</span><span class="cx"> #include &quot;BackForwardClient.h&quot;
</span><span class="cx"> #include &quot;DatabaseProvider.h&quot;
</span><ins>+#include &quot;DiagnosticLoggingClient.h&quot;
</ins><span class="cx"> #include &quot;StorageNamespaceProvider.h&quot;
</span><span class="cx"> #include &quot;UserContentController.h&quot;
</span><span class="cx"> #include &quot;VisitedLinkStore.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.h (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.h        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebCore/page/PageConfiguration.h        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -75,7 +75,7 @@
</span><span class="cx">     RefPtr&lt;BackForwardClient&gt; backForwardClient;
</span><span class="cx">     ValidationMessageClient* validationMessageClient { nullptr };
</span><span class="cx">     FrameLoaderClient* loaderClientForMainFrame { nullptr };
</span><del>-    DiagnosticLoggingClient* diagnosticLoggingClient { nullptr };
</del><ins>+    std::unique_ptr&lt;DiagnosticLoggingClient&gt; diagnosticLoggingClient { nullptr };
</ins><span class="cx"> 
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> #include &lt;WebKitAdditions/PageConfigurationMembers.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebKit2/ChangeLog        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-04-23  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Tie the DiagnosticLoggingClient's lifetime to the Page
+        https://bugs.webkit.org/show_bug.cgi?id=156938
+        &lt;rdar://problem/25851499&gt;
+
+        Reviewed by Antti Koivisto.
+
+        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
+        (WebKit::WebDiagnosticLoggingClient::pageDestroyed):
+        (WebKit::WebDiagnosticLoggingClient::mainFrameDestroyed): Deleted.
+        * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::willStartUserTriggeredZooming):
+
</ins><span class="cx"> 2016-04-23  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;rdar://problem/25893246&gt; WebKit2 has failed to build: error: use of undeclared identifier 'm_playbackSessionManager'
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebDiagnosticLoggingClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -77,9 +77,4 @@
</span><span class="cx">     m_page.send(Messages::WebPageProxy::LogSampledDiagnosticMessageWithValue(message, description, value));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebDiagnosticLoggingClient::mainFrameDestroyed()
-{
-    delete this;
-}
-
</del><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebDiagnosticLoggingClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.h        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -43,8 +43,6 @@
</span><span class="cx">     void logDiagnosticMessageWithResult(const String&amp; message, const String&amp; description, WebCore::DiagnosticLoggingResultType, WebCore::ShouldSample) override;
</span><span class="cx">     void logDiagnosticMessageWithValue(const String&amp; message, const String&amp; description, const String&amp; value, WebCore::ShouldSample) override;
</span><span class="cx"> 
</span><del>-    void mainFrameDestroyed() override;
-
</del><span class="cx">     WebPage&amp; m_page;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -401,7 +401,7 @@
</span><span class="cx">     pageConfiguration.plugInClient = new WebPlugInClient(*this);
</span><span class="cx">     pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
</span><span class="cx">     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(*this);
</span><del>-    pageConfiguration.diagnosticLoggingClient = new WebDiagnosticLoggingClient(*this);
</del><ins>+    pageConfiguration.diagnosticLoggingClient = std::make_unique&lt;WebDiagnosticLoggingClient&gt;(*this);
</ins><span class="cx"> 
</span><span class="cx">     pageConfiguration.applicationCacheStorage = &amp;WebProcess::singleton().applicationCacheStorage();
</span><span class="cx">     pageConfiguration.databaseProvider = WebDatabaseProvider::getOrCreate(m_pageGroup-&gt;pageGroupID());
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (199954 => 199955)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-04-23 17:45:35 UTC (rev 199954)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-04-23 21:33:49 UTC (rev 199955)
</span><span class="lines">@@ -2990,7 +2990,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::willStartUserTriggeredZooming()
</span><span class="cx"> {
</span><del>-    m_page-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::webViewKey(), DiagnosticLoggingKeys::userKey(), DiagnosticLoggingKeys::zoomedKey(), ShouldSample::No);
</del><ins>+    m_page-&gt;diagnosticLoggingClient().logDiagnosticMessageWithValue(DiagnosticLoggingKeys::webViewKey(), DiagnosticLoggingKeys::userKey(), DiagnosticLoggingKeys::zoomedKey(), ShouldSample::No);
</ins><span class="cx">     m_userHasChangedPageScaleFactor = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>