<!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>[171419] branches/safari-600.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/171419">171419</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-07-22 23:02:10 -0700 (Tue, 22 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/171239">r171239</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6001branchSourceWebCoreChangeLog">branches/safari-600.1-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreloaderFrameLoaderClienth">branches/safari-600.1-branch/Source/WebCore/loader/FrameLoaderClient.h</a></li>
<li><a href="#branchessafari6001branchSourceWebCoreloaderHistoryControllercpp">branches/safari-600.1-branch/Source/WebCore/loader/HistoryController.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2ChangeLog">branches/safari-600.1-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2UIProcessWebPageProxycpp">branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2UIProcessWebPageProxyh">branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2UIProcessWebPageProxymessagesin">branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2UIProcessiosViewGestureControllerIOSmm">branches/safari-600.1-branch/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2UIProcessmacViewGestureControllerMacmm">branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2UIProcessmacViewSnapshotStoreh">branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2UIProcessmacViewSnapshotStoremm">branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth">branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2WebProcessWebPageWebPagecpp">branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#branchessafari6001branchSourceWebKit2WebProcessWebPageWebPageh">branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6001branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/ChangeLog (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/ChangeLog        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebCore/ChangeLog        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -1,5 +1,32 @@
</span><span class="cx"> 2014-07-22 Dana Burkart &lt;dburkart@apple.com&gt;
</span><span class="cx">     
</span><ins>+        Merge r171239.
+
+    2014-07-18  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            Take navigation snapshots whenever the current back-forward item is going to change
+            https://bugs.webkit.org/show_bug.cgi?id=135058
+            &lt;rdar://problem/17464515&gt;
+
+            Reviewed by Dan Bernstein.
+
+            * loader/HistoryController.cpp:
+            (WebCore::HistoryController::updateForCommit):
+            (WebCore::HistoryController::recursiveUpdateForCommit):
+            (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
+            (WebCore::HistoryController::createItem):
+            Use setCurrentItem instead of duplicating the contents of it inside each of these functions.
+
+            (WebCore::HistoryController::setCurrentItem):
+            (WebCore::HistoryController::replaceCurrentItem):
+            When setting or replacing the current item, let the FrameLoaderClient know that we're going
+            to change which history item is &quot;current&quot;.
+
+            * loader/FrameLoaderClient.h:
+            (WebCore::FrameLoaderClient::willChangeCurrentHistoryItem): Added.
+
+2014-07-22 Dana Burkart &lt;dburkart@apple.com&gt;
+    
</ins><span class="cx">         Merge r171215.
</span><span class="cx"> 
</span><span class="cx">     2014-07-17  Jer Noble  &lt;jer.noble@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreloaderFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/loader/FrameLoaderClient.h (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/loader/FrameLoaderClient.h        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebCore/loader/FrameLoaderClient.h        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -204,6 +204,8 @@
</span><span class="cx">         virtual bool shouldGoToHistoryItem(HistoryItem*) const = 0;
</span><span class="cx">         virtual void updateGlobalHistoryItemForPage() { }
</span><span class="cx"> 
</span><ins>+        virtual void willChangeCurrentHistoryItem() { }
+
</ins><span class="cx">         // This frame has set its opener to null, disowning it for the lifetime of the frame.
</span><span class="cx">         // See http://html.spec.whatwg.org/#dom-opener.
</span><span class="cx">         // FIXME: JSC should allow disowning opener. - &lt;https://bugs.webkit.org/show_bug.cgi?id=103913&gt;.
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebCoreloaderHistoryControllercpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebCore/loader/HistoryController.cpp (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebCore/loader/HistoryController.cpp        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebCore/loader/HistoryController.cpp        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -465,10 +465,8 @@
</span><span class="cx">         // the provisional item for restoring state.
</span><span class="cx">         // Note previousItem must be set before we close the URL, which will
</span><span class="cx">         // happen when the data source is made non-provisional below
</span><del>-        m_frameLoadComplete = false;
-        m_previousItem = m_currentItem;
</del><span class="cx">         ASSERT(m_provisionalItem);
</span><del>-        m_currentItem = m_provisionalItem;
</del><ins>+        setCurrentItem(m_provisionalItem.get());
</ins><span class="cx">         m_provisionalItem = 0;
</span><span class="cx"> 
</span><span class="cx">         // Tell all other frames in the tree to commit their provisional items and
</span><span class="lines">@@ -509,9 +507,7 @@
</span><span class="cx">             view-&gt;setWasScrolledByUser(false);
</span><span class="cx"> 
</span><span class="cx">         // Now commit the provisional item
</span><del>-        m_frameLoadComplete = false;
-        m_previousItem = m_currentItem;
-        m_currentItem = m_provisionalItem;
</del><ins>+        setCurrentItem(m_provisionalItem.get());
</ins><span class="cx">         m_provisionalItem = 0;
</span><span class="cx"> 
</span><span class="cx">         // Restore form state (works from currentItem)
</span><span class="lines">@@ -560,9 +556,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Commit the provisional item.
</span><del>-    m_frameLoadComplete = false;
-    m_previousItem = m_currentItem;
-    m_currentItem = m_provisionalItem;
</del><ins>+    setCurrentItem(m_provisionalItem.get());
</ins><span class="cx">     m_provisionalItem = 0;
</span><span class="cx"> 
</span><span class="cx">     // Iterate over the rest of the tree.
</span><span class="lines">@@ -580,6 +574,8 @@
</span><span class="cx"> 
</span><span class="cx"> void HistoryController::setCurrentItem(HistoryItem* item)
</span><span class="cx"> {
</span><ins>+    m_frame.loader().client().willChangeCurrentHistoryItem();
+
</ins><span class="cx">     m_frameLoadComplete = false;
</span><span class="cx">     m_previousItem = m_currentItem;
</span><span class="cx">     m_currentItem = item;
</span><span class="lines">@@ -658,9 +654,7 @@
</span><span class="cx">     initializeItem(item.get());
</span><span class="cx">     
</span><span class="cx">     // Set the item for which we will save document state
</span><del>-    m_frameLoadComplete = false;
-    m_previousItem = m_currentItem;
-    m_currentItem = item;
</del><ins>+    setCurrentItem(item.get());
</ins><span class="cx">     
</span><span class="cx">     return item.release();
</span><span class="cx"> }
</span><span class="lines">@@ -888,8 +882,10 @@
</span><span class="cx">     m_previousItem = nullptr;
</span><span class="cx">     if (m_provisionalItem)
</span><span class="cx">         m_provisionalItem = item;
</span><del>-    else
</del><ins>+    else {
+        m_frame.loader().client().willChangeCurrentHistoryItem();
</ins><span class="cx">         m_currentItem = item;
</span><ins>+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/ChangeLog (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/ChangeLog        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/ChangeLog        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -1,5 +1,78 @@
</span><span class="cx"> 2014-07-22 Dana Burkart &lt;dburkart@apple.com&gt;
</span><span class="cx">     
</span><ins>+        Merge r171239.
+
+    2014-07-18  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+            Take navigation snapshots whenever the current back-forward item is going to change
+            https://bugs.webkit.org/show_bug.cgi?id=135058
+            &lt;rdar://problem/17464515&gt;
+
+            Reviewed by Dan Bernstein.
+
+            Instead of trying to have the UI process figure out when to take navigation snapshots by itself,
+            snapshot whenever the Web process says that the current back-forward item is going to change.
+            This fixes snapshotting timing with pushState, and lets us bottleneck snapshotting down to
+            just two places instead of 5.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::goForward):
+            (WebKit::WebPageProxy::goBack):
+            (WebKit::WebPageProxy::goToBackForwardItem):
+            (WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
+            We no longer need to special-case taking navigation snapshots
+            when the UI process changes the back forward item or upon
+            didStartProvisionalLoadForFrame, because we'll always snapshot
+            in willChangeCurrentHistoryItem in all of these cases.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::willChangeCurrentHistoryItem):
+            * UIProcess/WebPageProxy.h:
+            * UIProcess/WebPageProxy.messages.in:
+            Add willChangeCurrentHistoryItem message, which comes from the Web process.
+            When it arrives, take a navigation snapshot.
+
+            * UIProcess/ios/ViewGestureControllerIOS.mm:
+            (WebKit::ViewGestureController::beginSwipeGesture):
+            Take the pre-swipe navigation snapshot before telling WebPageProxy that we're doing a swipe,
+            so that it doesn't bail from taking the snapshot because we have a snapshot up.
+
+            (WebKit::ViewGestureController::endSwipeGesture):
+            We no longer need to explicitly disable snapshotting while navigating, because
+            we will avoid taking the snapshot if there's a snapshot being displayed.
+
+            * UIProcess/mac/ViewGestureControllerMac.mm:
+            (WebKit::ViewGestureController::~ViewGestureController):
+            Remove the snapshot if it's still up when ViewGestureController is destroyed.
+            The Mac version of ViewGestureController is destroyed on Web process crashes
+            because it is a message receiver, so it is not guaranteed to have the same
+            lifetime as the WebPageProxy and friends.
+
+            (WebKit::ViewGestureController::trackSwipeGesture):
+            Make use of recordNavigationSnapshot.
+
+            (WebKit::ViewGestureController::endSwipeGesture):
+            Ditto from the Mac version.
+
+            * UIProcess/mac/ViewSnapshotStore.h:
+            (WebKit::ViewSnapshotStore::disableSnapshotting): Deleted.
+            (WebKit::ViewSnapshotStore::enableSnapshotting): Deleted.
+            * UIProcess/mac/ViewSnapshotStore.mm:
+            (WebKit::ViewSnapshotStore::ViewSnapshotStore):
+            (WebKit::ViewSnapshotStore::recordSnapshot):
+            Remove the snapshot disabling mechanism and bail from snapshotting if we're
+            showing a snapshot, as mentioned above.
+
+            * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+            (WebKit::WebFrameLoaderClient::willChangeCurrentHistoryItem):
+            * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::willChangeCurrentHistoryItem):
+            * WebProcess/WebPage/WebPage.h:
+            Proxy willChangeCurrentHistoryItem from HistoryController to the UI process.
+
+2014-07-22 Dana Burkart &lt;dburkart@apple.com&gt;
+    
</ins><span class="cx">         Merge r171225.
</span><span class="cx"> 
</span><span class="cx">     2014-07-18  Jon Honeycutt  &lt;jhoneycutt@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -893,8 +893,6 @@
</span><span class="cx">     if (!forwardItem)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    recordNavigationSnapshot();
-
</del><span class="cx">     auto transaction = m_pageLoadState.transaction();
</span><span class="cx"> 
</span><span class="cx">     m_pageLoadState.setPendingAPIRequestURL(transaction, forwardItem-&gt;url());
</span><span class="lines">@@ -916,8 +914,6 @@
</span><span class="cx">     if (!backItem)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    recordNavigationSnapshot();
-
</del><span class="cx">     auto transaction = m_pageLoadState.transaction();
</span><span class="cx"> 
</span><span class="cx">     m_pageLoadState.setPendingAPIRequestURL(transaction, backItem-&gt;url());
</span><span class="lines">@@ -938,8 +934,6 @@
</span><span class="cx">     if (!isValid())
</span><span class="cx">         return reattachToWebProcessWithItem(item);
</span><span class="cx"> 
</span><del>-    recordNavigationSnapshot();
-    
</del><span class="cx">     auto transaction = m_pageLoadState.transaction();
</span><span class="cx"> 
</span><span class="cx">     m_pageLoadState.setPendingAPIRequestURL(transaction, item-&gt;url());
</span><span class="lines">@@ -2508,10 +2502,8 @@
</span><span class="cx">     MESSAGE_CHECK(frame);
</span><span class="cx">     MESSAGE_CHECK_URL(url);
</span><span class="cx"> 
</span><del>-    if (frame-&gt;isMainFrame()) {
-        recordNavigationSnapshot();
</del><ins>+    if (frame-&gt;isMainFrame())
</ins><span class="cx">         m_pageLoadState.didStartProvisionalLoad(transaction, url, unreachableURL);
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     frame-&gt;setUnreachableURL(unreachableURL);
</span><span class="cx">     frame-&gt;didStartProvisionalLoad(url);
</span><span class="lines">@@ -5160,4 +5152,9 @@
</span><span class="cx">     m_isShowingNavigationGestureSnapshot = false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::willChangeCurrentHistoryItem()
+{
+    recordNavigationSnapshot();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.h        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -1031,6 +1031,7 @@
</span><span class="cx">     void didBlockInsecurePluginVersion(const String&amp; mimeType, const String&amp; pluginURLString, const String&amp; frameURLString, const String&amp; pageURLString, bool replacementObscured);
</span><span class="cx"> #endif // ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx">     void setCanShortCircuitHorizontalWheelEvents(bool canShortCircuitHorizontalWheelEvents) { m_canShortCircuitHorizontalWheelEvents = canShortCircuitHorizontalWheelEvents; }
</span><ins>+    void willChangeCurrentHistoryItem();
</ins><span class="cx"> 
</span><span class="cx">     void reattachToWebProcess();
</span><span class="cx">     uint64_t reattachToWebProcessWithItem(WebBackForwardListItem*);
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -403,4 +403,6 @@
</span><span class="cx">     DidStartLoadForQuickLookDocumentInMainFrame(String fileName, String uti)
</span><span class="cx">     DidFinishLoadForQuickLookDocumentInMainFrame(WebKit::QuickLookDocumentData data)
</span><span class="cx"> #endif
</span><ins>+
+    WillChangeCurrentHistoryItem()
</ins><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2UIProcessiosViewGestureControllerIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -165,12 +165,11 @@
</span><span class="cx">     if (m_activeGestureType != ViewGestureType::None)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_webPageProxyForBackForwardListForCurrentSwipe = m_alternateBackForwardListSourceView.get() ? m_alternateBackForwardListSourceView.get()-&gt;_page : &amp;m_webPageProxy;
</del><ins>+    m_webPageProxy.recordNavigationSnapshot();
</ins><span class="cx"> 
</span><ins>+    m_webPageProxyForBackForwardListForCurrentSwipe = m_alternateBackForwardListSourceView.get() ? m_alternateBackForwardListSourceView.get()-&gt;_page : &amp;m_webPageProxy;
</ins><span class="cx">     m_webPageProxyForBackForwardListForCurrentSwipe-&gt;navigationGestureDidBegin();
</span><span class="cx"> 
</span><del>-    m_webPageProxy.recordNavigationSnapshot();
-
</del><span class="cx">     auto backForwardList = m_webPageProxyForBackForwardListForCurrentSwipe-&gt;backForwardList();
</span><span class="cx"> 
</span><span class="cx">     // Copy the snapshot from this view to the one that owns the back forward list, so that
</span><span class="lines">@@ -273,16 +272,9 @@
</span><span class="cx">     if (ViewSnapshot* snapshot = targetItem-&gt;snapshot())
</span><span class="cx">         m_snapshotRemovalTargetRenderTreeSize = snapshot-&gt;renderTreeSize() * swipeSnapshotRemovalRenderTreeSizeTargetFraction;
</span><span class="cx"> 
</span><del>-    // We don't want to replace the current back-forward item's snapshot
-    // like we normally would when going back or forward, because we are
-    // displaying the destination item's snapshot.
-    ViewSnapshotStore::shared().disableSnapshotting();
-
</del><span class="cx">     m_webPageProxyForBackForwardListForCurrentSwipe-&gt;navigationGestureDidEnd(true, *targetItem);
</span><span class="cx">     m_webPageProxyForBackForwardListForCurrentSwipe-&gt;goToBackForwardItem(targetItem);
</span><span class="cx"> 
</span><del>-    ViewSnapshotStore::shared().enableSnapshotting();
-
</del><span class="cx">     uint64_t pageID = m_webPageProxy.pageID();
</span><span class="cx">     m_webPageProxy.drawingArea()-&gt;dispatchAfterEnsuringDrawing([pageID] (CallbackBase::Error error) {
</span><span class="cx">         auto gestureControllerIter = viewGestureControllersForAllPages().find(pageID);
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2UIProcessmacViewGestureControllerMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -114,6 +114,9 @@
</span><span class="cx">     if (m_swipeCancellationTracker)
</span><span class="cx">         [m_swipeCancellationTracker setIsCancelled:YES];
</span><span class="cx"> 
</span><ins>+    if (m_activeGestureType == ViewGestureType::Swipe)
+        removeSwipeSnapshot();
+
</ins><span class="cx">     m_webPageProxy.process().removeMessageReceiver(Messages::ViewGestureController::messageReceiverName(), m_webPageProxy.pageID());
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -366,7 +369,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ViewGestureController::trackSwipeGesture(NSEvent *event, SwipeDirection direction)
</span><span class="cx"> {
</span><del>-    ViewSnapshotStore::shared().recordSnapshot(m_webPageProxy);
</del><ins>+    m_webPageProxy.recordNavigationSnapshot();
</ins><span class="cx"> 
</span><span class="cx">     CGFloat maxProgress = (direction == SwipeDirection::Left) ? 1 : 0;
</span><span class="cx">     CGFloat minProgress = (direction == SwipeDirection::Right) ? -1 : 0;
</span><span class="lines">@@ -638,13 +641,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_webPageProxy.process().send(Messages::ViewGestureGeometryCollector::SetRenderTreeSizeNotificationThreshold(renderTreeSize * swipeSnapshotRemovalRenderTreeSizeTargetFraction), m_webPageProxy.pageID());
</span><span class="cx"> 
</span><del>-    // We don't want to replace the current back-forward item's snapshot
-    // like we normally would when going back or forward, because we are
-    // displaying the destination item's snapshot.
-    ViewSnapshotStore::shared().disableSnapshotting();
</del><span class="cx">     m_webPageProxy.navigationGestureDidEnd(true, *targetItem);
</span><span class="cx">     m_webPageProxy.goToBackForwardItem(targetItem);
</span><del>-    ViewSnapshotStore::shared().enableSnapshotting();
</del><span class="cx"> 
</span><span class="cx">     if (!renderTreeSize) {
</span><span class="cx">         removeSwipeSnapshot();
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2UIProcessmacViewSnapshotStoreh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -119,9 +119,6 @@
</span><span class="cx"> 
</span><span class="cx">     void recordSnapshot(WebPageProxy&amp;);
</span><span class="cx"> 
</span><del>-    void disableSnapshotting() { m_enabled = false; }
-    void enableSnapshotting() { m_enabled = true; }
-
</del><span class="cx">     void discardSnapshotImages();
</span><span class="cx"> 
</span><span class="cx"> #if USE_RENDER_SERVER_VIEW_SNAPSHOTS
</span><span class="lines">@@ -133,7 +130,6 @@
</span><span class="cx">     void willRemoveImageFromSnapshot(ViewSnapshot&amp;);
</span><span class="cx">     void pruneSnapshots(WebPageProxy&amp;);
</span><span class="cx"> 
</span><del>-    bool m_enabled;
</del><span class="cx">     size_t m_snapshotCacheSize;
</span><span class="cx"> 
</span><span class="cx">     ListHashSet&lt;ViewSnapshot*&gt; m_snapshotsWithImages;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2UIProcessmacViewSnapshotStoremm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -47,8 +47,7 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> ViewSnapshotStore::ViewSnapshotStore()
</span><del>-    : m_enabled(true)
-    , m_snapshotCacheSize(0)
</del><ins>+    : m_snapshotCacheSize(0)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -109,11 +108,11 @@
</span><span class="cx"> 
</span><span class="cx"> void ViewSnapshotStore::recordSnapshot(WebPageProxy&amp; webPageProxy)
</span><span class="cx"> {
</span><del>-    WebBackForwardListItem* item = webPageProxy.backForwardList().currentItem();
-
-    if (!m_enabled)
</del><ins>+    if (webPageProxy.isShowingNavigationGestureSnapshot())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    WebBackForwardListItem* item = webPageProxy.backForwardList().currentItem();
+
</ins><span class="cx">     if (!item)
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -1621,4 +1621,13 @@
</span><span class="cx">     return context.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebFrameLoaderClient::willChangeCurrentHistoryItem()
+{
+    WebPage* webPage = m_frame-&gt;page();
+    if (!webPage)
+        return;
+
+    webPage-&gt;willChangeCurrentHistoryItem();
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.h        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -130,6 +130,7 @@
</span><span class="cx">     virtual void updateGlobalHistoryRedirectLinks() override;
</span><span class="cx">     
</span><span class="cx">     virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const override;
</span><ins>+    virtual void willChangeCurrentHistoryItem() override;
</ins><span class="cx"> 
</span><span class="cx">     virtual void didDisplayInsecureContent() override;
</span><span class="cx">     virtual void didRunInsecureContent(WebCore::SecurityOrigin*, const WebCore::URL&amp;) override;
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -4827,4 +4827,9 @@
</span><span class="cx">     updateMainFrameScrollOffsetPinning();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPage::willChangeCurrentHistoryItem()
+{
+    send(Messages::WebPageProxy::WillChangeCurrentHistoryItem());
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="branchessafari6001branchSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h (171418 => 171419)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-07-23 05:59:29 UTC (rev 171418)
+++ branches/safari-600.1-branch/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-07-23 06:02:10 UTC (rev 171419)
</span><span class="lines">@@ -839,6 +839,8 @@
</span><span class="cx"> 
</span><span class="cx">     void didChangeScrollOffsetForFrame(WebCore::Frame*);
</span><span class="cx"> 
</span><ins>+    void willChangeCurrentHistoryItem();
+
</ins><span class="cx"> private:
</span><span class="cx">     WebPage(uint64_t pageID, const WebPageCreationParameters&amp;);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>