<!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>[170719] trunk/Source/WebKit2</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/170719">170719</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-07-02 13:43:17 -0700 (Wed, 02 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Begin ripping out the old session state code
https://bugs.webkit.org/show_bug.cgi?id=134556

Reviewed by Andreas Kling.

* UIProcess/WebBackForwardList.h:
* UIProcess/WebPageProxy.h:
* UIProcess/cf/WebBackForwardListCF.cpp: Removed.
* UIProcess/cf/WebPageProxyCF.cpp:
(WebKit::WebPageProxy::sessionStateData): Deleted.
(WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebBackForwardListh">trunk/Source/WebKit2/UIProcess/WebBackForwardList.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcesscfWebPageProxyCFcpp">trunk/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcesscfWebBackForwardListCFcpp">trunk/Source/WebKit2/UIProcess/cf/WebBackForwardListCF.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (170718 => 170719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-02 20:29:42 UTC (rev 170718)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-02 20:43:17 UTC (rev 170719)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2014-07-02  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Begin ripping out the old session state code
+        https://bugs.webkit.org/show_bug.cgi?id=134556
+
+        Reviewed by Andreas Kling.
+
+        * UIProcess/WebBackForwardList.h:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/cf/WebBackForwardListCF.cpp: Removed.
+        * UIProcess/cf/WebPageProxyCF.cpp:
+        (WebKit::WebPageProxy::sessionStateData): Deleted.
+        (WebKit::WebPageProxy::restoreFromSessionStateData): Deleted.
+        * WebKit2.xcodeproj/project.pbxproj:
+
+2014-07-02  Anders Carlsson  &lt;andersca@apple.com&gt;
+
</ins><span class="cx">         Use legacy state coding directly in WKWebView
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=134553
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebBackForwardListh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebBackForwardList.h (170718 => 170719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebBackForwardList.h        2014-07-02 20:29:42 UTC (rev 170718)
+++ trunk/Source/WebKit2/UIProcess/WebBackForwardList.h        2014-07-02 20:43:17 UTC (rev 170719)
</span><span class="lines">@@ -72,13 +72,6 @@
</span><span class="cx">     PassRefPtr&lt;API::Array&gt; backListAsAPIArrayWithLimit(unsigned limit) const;
</span><span class="cx">     PassRefPtr&lt;API::Array&gt; forwardListAsAPIArrayWithLimit(unsigned limit) const;
</span><span class="cx"> 
</span><del>-#if USE(CF)
-    CFDictionaryRef createCFDictionaryRepresentation(std::function&lt;bool (WebBackForwardListItem&amp;)&gt;) const;
-    bool restoreFromCFDictionaryRepresentation(CFDictionaryRef);
-    bool restoreFromV0CFDictionaryRepresentation(CFDictionaryRef);
-    bool restoreFromV1CFDictionaryRepresentation(CFDictionaryRef);
-#endif
-
</del><span class="cx">     BackForwardListState backForwardListState(const std::function&lt;bool (WebBackForwardListItem&amp;)&gt;&amp;) const;
</span><span class="cx">     void restoreFromState(BackForwardListState);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (170718 => 170719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-07-02 20:29:42 UTC (rev 170718)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-07-02 20:43:17 UTC (rev 170719)
</span><span class="lines">@@ -551,8 +551,6 @@
</span><span class="cx">     void terminateProcess();
</span><span class="cx"> 
</span><span class="cx">     SessionState sessionState(const std::function&lt;bool (WebBackForwardListItem&amp;)&gt;&amp; = nullptr) const;
</span><del>-    PassRefPtr&lt;API::Data&gt; sessionStateData(std::function&lt;bool (WebBackForwardListItem&amp;)&gt;) const;
-    uint64_t restoreFromSessionStateData(API::Data*);
</del><span class="cx">     uint64_t restoreFromSessionState(SessionState);
</span><span class="cx"> 
</span><span class="cx">     bool supportsTextZoom() const;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcesscfWebBackForwardListCFcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/UIProcess/cf/WebBackForwardListCF.cpp (170718 => 170719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/cf/WebBackForwardListCF.cpp        2014-07-02 20:29:42 UTC (rev 170718)
+++ trunk/Source/WebKit2/UIProcess/cf/WebBackForwardListCF.cpp        2014-07-02 20:43:17 UTC (rev 170719)
</span><span class="lines">@@ -1,323 +0,0 @@
</span><del>-/*
- * Copyright (C) 2010, 2011, 2012, 2014 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;WebBackForwardList.h&quot;
-
-#include &quot;APIData.h&quot;
-#include &quot;Logging.h&quot;
-#include &lt;CoreFoundation/CoreFoundation.h&gt;
-#include &lt;wtf/NeverDestroyed.h&gt;
-#include &lt;wtf/RetainPtr.h&gt;
-
-using namespace WebCore;
-
-namespace WebKit {
-
-uint64_t generateWebBackForwardItemID();
-
-static CFNumberRef sessionHistoryCurrentVersion()
-{
-    static CFIndex currentVersionAsCFIndex = 1;
-    return CFNumberCreate(0, kCFNumberCFIndexType, &amp;currentVersionAsCFIndex);
-}
-
-static CFStringRef sessionHistoryVersionKey = CFSTR(&quot;SessionHistoryVersion&quot;);
-static CFStringRef sessionHistoryCurrentIndexKey = CFSTR(&quot;SessionHistoryCurrentIndex&quot;);
-static CFStringRef sessionHistoryEntriesKey = CFSTR(&quot;SessionHistoryEntries&quot;);
-static CFStringRef sessionHistoryEntryTitleKey = CFSTR(&quot;SessionHistoryEntryTitle&quot;);
-static CFStringRef sessionHistoryEntryURLKey = CFSTR(&quot;SessionHistoryEntryURL&quot;);
-static CFStringRef sessionHistoryEntryOriginalURLKey = CFSTR(&quot;SessionHistoryEntryOriginalURL&quot;);
-static CFStringRef sessionHistoryEntryDataKey = CFSTR(&quot;SessionHistoryEntryData&quot;);
-static CFStringRef sessionHistoryEntrySnapshotUUIDKey = CFSTR(&quot;SessionHistoryEntrySnapshotUUID&quot;);
-
-static bool extractBackForwardListEntriesFromArray(CFArrayRef, BackForwardListItemVector&amp;);
-
-static CFDictionaryRef createEmptySessionHistoryDictionary()
-{
-    static const void* keys[1] = { sessionHistoryVersionKey };
-    static const void* values[1] = { sessionHistoryCurrentVersion() };
-
-    return CFDictionaryCreate(0, keys, values, 1, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks);
-}
-
-CFDictionaryRef WebBackForwardList::createCFDictionaryRepresentation(std::function&lt;bool (WebBackForwardListItem&amp;)&gt; filter) const
-{
-    ASSERT(!m_hasCurrentIndex || m_currentIndex &lt; m_entries.size());
-
-    if (!m_hasCurrentIndex) {
-        // We represent having no current index by writing out an empty dictionary (besides the version).
-        return createEmptySessionHistoryDictionary();
-    }
-
-    RetainPtr&lt;CFMutableArrayRef&gt; entries = adoptCF(CFArrayCreateMutable(0, m_entries.size(), &amp;kCFTypeArrayCallBacks));
-
-    // We may need to update the current index to account for entries that are filtered by the callback.
-    CFIndex currentIndex = m_currentIndex;
-    bool hasCurrentIndex = true;
-
-    for (size_t i = 0; i &lt; m_entries.size(); ++i) {
-        // If we somehow ended up with a null entry then we should consider the data invalid and not save session history at all.
-        ASSERT(m_entries[i]);
-        if (!m_entries[i]) {
-            LOG(SessionState, &quot;WebBackForwardList contained a null entry at index %lu&quot;, i);
-            return 0;
-        }
-
-        if (filter &amp;&amp; !filter(*m_entries[i])) {
-            if (i &lt;= m_currentIndex)
-                currentIndex--;
-            continue;
-        }
-        
-        RetainPtr&lt;CFStringRef&gt; url = m_entries[i]-&gt;url().createCFString();
-        RetainPtr&lt;CFStringRef&gt; title = m_entries[i]-&gt;title().createCFString();
-        RetainPtr&lt;CFStringRef&gt; originalURL = m_entries[i]-&gt;originalURL().createCFString();
-        RetainPtr&lt;CFStringRef&gt; uuid = m_entries[i]-&gt;snapshotUUID().createCFString();
-
-        // FIXME: This uses the IPC data encoding format, which means that whenever we change the IPC encoding we need to bump the CurrentSessionStateDataVersion
-        // constant in WebPageProxyCF.cpp. The IPC data format is meant to be an implementation detail, and not something that should be written to disk.
-        RefPtr&lt;API::Data&gt; backForwardData = m_entries[i]-&gt;backForwardData();
-        RetainPtr&lt;CFDataRef&gt; entryData = adoptCF(CFDataCreate(kCFAllocatorDefault, backForwardData-&gt;bytes(), backForwardData-&gt;size()));
-
-        const void* keys[5] = { sessionHistoryEntryURLKey, sessionHistoryEntryTitleKey, sessionHistoryEntryOriginalURLKey, sessionHistoryEntryDataKey, sessionHistoryEntrySnapshotUUIDKey };
-        const void* values[5] = { url.get(), title.get(), originalURL.get(), entryData.get(), uuid.get() };
-
-        RetainPtr&lt;CFDictionaryRef&gt; entryDictionary = adoptCF(CFDictionaryCreate(0, keys, values, 5, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
-        CFArrayAppendValue(entries.get(), entryDictionary.get());
-    }
-        
-    ASSERT(currentIndex == -1 || (currentIndex &gt; -1 &amp;&amp; currentIndex &lt; CFArrayGetCount(entries.get())));
-    if (currentIndex &lt; -1 || currentIndex &gt;= CFArrayGetCount(entries.get())) {
-        LOG(SessionState, &quot;Filtering entries to be saved resulted in an inconsistent state that we cannot represent&quot;);
-        return 0;
-    }
-
-    // If we have an index and all items before and including the current item were filtered then currentIndex will be -1.
-    // In this case the new current index should point at the first item.
-    // It's also possible that all items were filtered so we should represent not having a current index.
-    if (currentIndex == -1) {
-        if (CFArrayGetCount(entries.get()))
-            currentIndex = 0;
-        else
-            hasCurrentIndex = false;
-    }
-
-    if (hasCurrentIndex) {
-        RetainPtr&lt;CFNumberRef&gt; currentIndexNumber = adoptCF(CFNumberCreate(0, kCFNumberCFIndexType, &amp;currentIndex));
-        const void* keys[3] = { sessionHistoryVersionKey, sessionHistoryCurrentIndexKey, sessionHistoryEntriesKey };
-        const void* values[3] = { sessionHistoryCurrentVersion(), currentIndexNumber.get(), entries.get() };

-        return CFDictionaryCreate(0, keys, values, 3, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks);
-    }
-
-    // We represent having no current index by writing out an empty dictionary (besides the version).
-    return createEmptySessionHistoryDictionary();
-}
-
-bool WebBackForwardList::restoreFromCFDictionaryRepresentation(CFDictionaryRef dictionary)
-{
-    CFNumberRef cfVersion = (CFNumberRef)CFDictionaryGetValue(dictionary, sessionHistoryVersionKey);
-    if (!cfVersion) {
-        // v0 session history dictionaries did not contain versioning
-        return restoreFromV0CFDictionaryRepresentation(dictionary);
-    }
-    
-    if (CFGetTypeID(cfVersion) != CFNumberGetTypeID()) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation contains a version that is not a number&quot;);
-        return false;
-    }
-
-    CFIndex version;
-    if (!CFNumberGetValue(cfVersion, kCFNumberCFIndexType, &amp;version)) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation does not have a correctly typed current version&quot;);
-        return false;
-    }
-    
-    if (version == 1)
-        return restoreFromV1CFDictionaryRepresentation(dictionary);
-    
-    LOG(SessionState, &quot;WebBackForwardList dictionary representation has an invalid current version (%ld)&quot;, version);
-    return false;
-}
-
-bool WebBackForwardList::restoreFromV0CFDictionaryRepresentation(CFDictionaryRef dictionary)
-{
-    CFNumberRef cfIndex = (CFNumberRef)CFDictionaryGetValue(dictionary, sessionHistoryCurrentIndexKey);
-    if (!cfIndex || CFGetTypeID(cfIndex) != CFNumberGetTypeID()) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation does not have a valid current index&quot;);
-        return false;
-    }
-
-    CFIndex currentCFIndex;
-    if (!CFNumberGetValue(cfIndex, kCFNumberCFIndexType, &amp;currentCFIndex)) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation does not have a correctly typed current index&quot;);
-        return false;
-    }
-    
-    if (currentCFIndex &lt; -1) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation contains an unexpected negative current index (%ld)&quot;, currentCFIndex);
-        return false;
-    }
-
-    CFArrayRef cfEntries = (CFArrayRef)CFDictionaryGetValue(dictionary, sessionHistoryEntriesKey);
-    if (!cfEntries || CFGetTypeID(cfEntries) != CFArrayGetTypeID()) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation does not have a valid list of entries&quot;);
-        return false;
-    }
-
-    CFIndex size = CFArrayGetCount(cfEntries);
-    if (size &lt; 0 || currentCFIndex &gt;= size) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation contains an invalid current index (%ld) for the number of entries (%ld)&quot;, currentCFIndex, size);
-        return false;
-    }
-
-    // Version 0 session history relied on currentIndex == -1 to represent the same thing as not having a current index.
-    bool hasCurrentIndex = currentCFIndex != -1;
-
-    if (!hasCurrentIndex &amp;&amp; size) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation says there is no current index, but there is a list of %ld entries&quot;, size);
-        return false;
-    }
-    
-    BackForwardListItemVector entries;
-    if (!extractBackForwardListEntriesFromArray(cfEntries, entries)) {
-        // extractBackForwardListEntriesFromArray has already logged the appropriate error message.
-        return false;
-    }
-
-    ASSERT(entries.size() == static_cast&lt;unsigned&gt;(size));
-    
-    m_hasCurrentIndex = hasCurrentIndex;
-    m_currentIndex = m_hasCurrentIndex ? static_cast&lt;uint32_t&gt;(currentCFIndex) : 0;
-    m_entries = entries;
-
-    return true;
-}
-
-bool WebBackForwardList::restoreFromV1CFDictionaryRepresentation(CFDictionaryRef dictionary)
-{
-    CFNumberRef cfIndex = (CFNumberRef)CFDictionaryGetValue(dictionary, sessionHistoryCurrentIndexKey);
-    if (!cfIndex) {
-        // No current index means the dictionary represents an empty session.
-        m_hasCurrentIndex = false;
-        m_currentIndex = 0;
-        m_entries.clear();
-
-        return true;
-    }
-
-    if (CFGetTypeID(cfIndex) != CFNumberGetTypeID()) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation does not have a valid current index&quot;);
-        return false;
-    }
-
-    CFIndex currentCFIndex;
-    if (!CFNumberGetValue(cfIndex, kCFNumberCFIndexType, &amp;currentCFIndex)) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation does not have a correctly typed current index&quot;);
-        return false;
-    }
-    
-    if (currentCFIndex &lt; 0) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation contains an unexpected negative current index (%ld)&quot;, currentCFIndex);
-        return false;
-    }
-
-    CFArrayRef cfEntries = (CFArrayRef)CFDictionaryGetValue(dictionary, sessionHistoryEntriesKey);
-    if (!cfEntries || CFGetTypeID(cfEntries) != CFArrayGetTypeID()) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation does not have a valid list of entries&quot;);
-        return false;
-    }
-
-    CFIndex size = CFArrayGetCount(cfEntries);
-    if (currentCFIndex &gt;= size) {
-        LOG(SessionState, &quot;WebBackForwardList dictionary representation contains an invalid current index (%ld) for the number of entries (%ld)&quot;, currentCFIndex, size);
-        return false;
-    }
-    
-    BackForwardListItemVector entries;
-    if (!extractBackForwardListEntriesFromArray(cfEntries, entries)) {
-        // extractBackForwardListEntriesFromArray has already logged the appropriate error message.
-        return false;
-    }
-    
-    ASSERT(entries.size() == static_cast&lt;unsigned&gt;(size));
-    
-    m_hasCurrentIndex = true;
-    m_currentIndex = static_cast&lt;uint32_t&gt;(currentCFIndex);
-    m_entries = entries;
-
-    return true;
-}
-
-static bool extractBackForwardListEntriesFromArray(CFArrayRef cfEntries, BackForwardListItemVector&amp; entries)
-{
-    CFIndex size = CFArrayGetCount(cfEntries);
-
-    entries.reserveCapacity(size);
-    for (CFIndex i = 0; i &lt; size; ++i) {
-        CFDictionaryRef entryDictionary = (CFDictionaryRef)CFArrayGetValueAtIndex(cfEntries, i);
-        if (!entryDictionary || CFGetTypeID(entryDictionary) != CFDictionaryGetTypeID()) {
-            LOG(SessionState, &quot;WebBackForwardList entry array does not have a valid entry at index %i&quot;, (int)i);
-            return false;
-        }
-        
-        CFStringRef entryURL = (CFStringRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntryURLKey);
-        if (!entryURL || CFGetTypeID(entryURL) != CFStringGetTypeID()) {
-            LOG(SessionState, &quot;WebBackForwardList entry at index %i does not have a valid URL&quot;, (int)i);
-            return false;
-        }
-
-        CFStringRef entryTitle = (CFStringRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntryTitleKey);
-        if (!entryTitle || CFGetTypeID(entryTitle) != CFStringGetTypeID()) {
-            LOG(SessionState, &quot;WebBackForwardList entry at index %i does not have a valid title&quot;, (int)i);
-            return false;
-        }
-
-        CFStringRef originalURL = (CFStringRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntryOriginalURLKey);
-        if (!originalURL || CFGetTypeID(originalURL) != CFStringGetTypeID()) {
-            LOG(SessionState, &quot;WebBackForwardList entry at index %i does not have a valid original URL&quot;, (int)i);
-            return false;
-        }
-
-        CFDataRef backForwardData = (CFDataRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntryDataKey);
-        if (!backForwardData || CFGetTypeID(backForwardData) != CFDataGetTypeID()) {
-            LOG(SessionState, &quot;WebBackForwardList entry at index %i does not have back/forward data&quot;, (int)i);
-            return false;
-        }
-
-        auto item = WebBackForwardListItem::create(originalURL, entryURL, entryTitle, CFDataGetBytePtr(backForwardData), CFDataGetLength(backForwardData), generateWebBackForwardItemID());
-
-        CFStringRef snapshotUUID = (CFStringRef)CFDictionaryGetValue(entryDictionary, sessionHistoryEntrySnapshotUUIDKey);
-        if (snapshotUUID &amp;&amp; CFGetTypeID(snapshotUUID) == CFStringGetTypeID())
-            item-&gt;setSnapshotUUID(snapshotUUID);
-
-        entries.append(item);
-    }
-
-    return true;
-}
-
-} // namespace WebKit
</del></span></pre></div>
<a id="trunkSourceWebKit2UIProcesscfWebPageProxyCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp (170718 => 170719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp        2014-07-02 20:29:42 UTC (rev 170718)
+++ trunk/Source/WebKit2/UIProcess/cf/WebPageProxyCF.cpp        2014-07-02 20:43:17 UTC (rev 170719)
</span><span class="lines">@@ -26,14 +26,6 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;WebPageProxy.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;APIData.h&quot;
-#include &quot;DataReference.h&quot;
-#include &quot;LegacySessionState.h&quot;
-#include &quot;Logging.h&quot;
-#include &quot;WebBackForwardList.h&quot;
-#include &quot;WebPageMessages.h&quot;
-#include &quot;WebProcessProxy.h&quot;
-#include &lt;CoreFoundation/CFPropertyList.h&gt;
</del><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/cf/TypeCasts.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -41,148 +33,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-static CFStringRef sessionHistoryKey = CFSTR(&quot;SessionHistory&quot;);
-static CFStringRef provisionalURLKey = CFSTR(&quot;ProvisionalURL&quot;);
-
-static const UInt32 CurrentSessionStateDataVersion = 2;
-
-PassRefPtr&lt;API::Data&gt; WebPageProxy::sessionStateData(std::function&lt;bool (WebBackForwardListItem&amp;)&gt; filter) const
-{
-    const void* keys[2];
-    const void* values[2];
-    CFIndex numValues = 0;
-
-    RetainPtr&lt;CFDictionaryRef&gt; sessionHistoryDictionary = adoptCF(m_backForwardList-&gt;createCFDictionaryRepresentation(std::move(filter)));
-    if (sessionHistoryDictionary) {
-        keys[numValues] = sessionHistoryKey;
-        values[numValues] = sessionHistoryDictionary.get();
-        ++numValues;
-    }
-
-    RetainPtr&lt;CFStringRef&gt; provisionalURLString;
-    if (m_mainFrame) {
-        String provisionalURL = m_pageLoadState.pendingAPIRequestURL();
-        if (provisionalURL.isEmpty())
-            provisionalURL = m_mainFrame-&gt;provisionalURL();
-        if (!provisionalURL.isEmpty()) {
-            provisionalURLString = provisionalURL.createCFString();
-            keys[numValues] = provisionalURLKey;
-            values[numValues] = provisionalURLString.get();
-            ++numValues;
-        }
-    }
-
-    if (!numValues)
-        return 0;
-
-    RetainPtr&lt;CFDictionaryRef&gt; stateDictionary = adoptCF(CFDictionaryCreate(0, keys, values, numValues, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
-
-    RetainPtr&lt;CFWriteStreamRef&gt; writeStream = adoptCF(CFWriteStreamCreateWithAllocatedBuffers(0, 0));
-    if (!writeStream)
-        return 0;
-    
-    if (!CFWriteStreamOpen(writeStream.get()))
-        return 0;
-    
-    if (!CFPropertyListWrite(stateDictionary.get(), writeStream.get(), kCFPropertyListBinaryFormat_v1_0, 0, 0))
-        return 0;
-        
-    RetainPtr&lt;CFDataRef&gt; stateCFData = adoptCF((CFDataRef)CFWriteStreamCopyProperty(writeStream.get(), kCFStreamPropertyDataWritten));
-
-    CFIndex length = CFDataGetLength(stateCFData.get());
-    Vector&lt;unsigned char&gt; stateVector(length + sizeof(UInt32));
-    
-    // Put the session state version number at the start of the buffer
-    stateVector.data()[0] = (CurrentSessionStateDataVersion &amp; 0xFF000000) &gt;&gt; 24;
-    stateVector.data()[1] = (CurrentSessionStateDataVersion &amp; 0x00FF0000) &gt;&gt; 16;
-    stateVector.data()[2] = (CurrentSessionStateDataVersion &amp; 0x0000FF00) &gt;&gt; 8;
-    stateVector.data()[3] = (CurrentSessionStateDataVersion &amp; 0x000000FF);
-    
-    // Copy in the actual session state data
-    CFDataGetBytes(stateCFData.get(), CFRangeMake(0, length), stateVector.data() + sizeof(UInt32));
-    
-    return API::Data::create(stateVector);
-}
-
-uint64_t WebPageProxy::restoreFromSessionStateData(API::Data* apiData)
-{
-    if (!apiData || apiData-&gt;size() &lt; sizeof(UInt32))
-        return 0;
-
-    const unsigned char* buffer = apiData-&gt;bytes();
-    UInt32 versionHeader = (buffer[0] &lt;&lt; 24) + (buffer[1] &lt;&lt; 16) + (buffer[2] &lt;&lt; 8) + buffer[3];
-    
-    if (versionHeader != CurrentSessionStateDataVersion) {
-        LOG(SessionState, &quot;Unrecognized version header for session state data - cannot restore&quot;);
-        return 0;
-    }
-    
-    RetainPtr&lt;CFDataRef&gt; data = adoptCF(CFDataCreate(0, apiData-&gt;bytes() + sizeof(UInt32), apiData-&gt;size() - sizeof(UInt32)));
-
-    CFErrorRef propertyListError = 0;
-    auto propertyList = adoptCF(CFPropertyListCreateWithData(0, data.get(), kCFPropertyListImmutable, 0, &amp;propertyListError));
-    if (propertyListError) {
-        CFRelease(propertyListError);
-        LOG(SessionState, &quot;Could not read session state property list&quot;);
-        return 0;
-    }
-
-    if (!propertyList)
-        return 0;
-        
-    if (CFGetTypeID(propertyList.get()) != CFDictionaryGetTypeID()) {
-        LOG(SessionState, &quot;SessionState property list is not a CFDictionaryRef (%i) - its CFTypeID is %i&quot;, (int)CFDictionaryGetTypeID(), (int)CFGetTypeID(propertyList.get()));
-        return 0;
-    }
-
-    CFDictionaryRef backForwardListDictionary = 0;
-    if (CFTypeRef value = CFDictionaryGetValue(static_cast&lt;CFDictionaryRef&gt;(propertyList.get()), sessionHistoryKey)) {
-        if (CFGetTypeID(value) != CFDictionaryGetTypeID())
-            LOG(SessionState, &quot;SessionState dictionary has a SessionHistory key, but the value is not a dictionary&quot;);
-        else
-            backForwardListDictionary = static_cast&lt;CFDictionaryRef&gt;(value);
-    }
-
-    CFStringRef provisionalURL = 0;
-    if (CFTypeRef value = CFDictionaryGetValue(static_cast&lt;CFDictionaryRef&gt;(propertyList.get()), provisionalURLKey)) {
-        if (CFGetTypeID(value) != CFStringGetTypeID())
-            LOG(SessionState, &quot;SessionState dictionary has a ProvisionalValue key, but the value is not a string&quot;);
-        else
-            provisionalURL = static_cast&lt;CFStringRef&gt;(value);
-    }
-
-    auto transaction = m_pageLoadState.transaction();
-
-    if (backForwardListDictionary) {
-        if (!m_backForwardList-&gt;restoreFromCFDictionaryRepresentation(backForwardListDictionary))
-            LOG(SessionState, &quot;Failed to restore back/forward list from SessionHistory dictionary&quot;);
-        else {
-            const BackForwardListItemVector&amp; entries = m_backForwardList-&gt;entries();
-            if (size_t size = entries.size()) {
-                for (size_t i = 0; i &lt; size; ++i)
-                    process().registerNewWebBackForwardListItem(entries[i].get());
-
-                LegacySessionState state(m_backForwardList-&gt;entries(), m_backForwardList-&gt;currentIndex());
-                if (provisionalURL)
-                    process().send(Messages::WebPage::RestoreSession(state), m_pageID);
-                else {
-                    if (WebBackForwardListItem* item = m_backForwardList-&gt;currentItem())
-                        m_pageLoadState.setPendingAPIRequestURL(transaction, item-&gt;url());
-
-                    uint64_t navigationID = generateNavigationID();
-                    process().send(Messages::WebPage::RestoreSessionAndNavigateToCurrentItem(navigationID, state), m_pageID);
-                    return navigationID;
-                }
-            }
-        }
-    }
-
-    if (provisionalURL)
-        return loadRequest(URL(URL(), provisionalURL));
-
-    return 0;
-}
-
</del><span class="cx"> static RetainPtr&lt;CFStringRef&gt; autosaveKey(const String&amp; name)
</span><span class="cx"> {
</span><span class="cx">     return String(&quot;com.apple.WebKit.searchField:&quot; + name).createCFString();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (170718 => 170719)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-07-02 20:29:42 UTC (rev 170718)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-07-02 20:43:17 UTC (rev 170719)
</span><span class="lines">@@ -933,7 +933,6 @@
</span><span class="cx">                 51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */; };
</span><span class="cx">                 51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */; };
</span><span class="cx">                 51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */; };
</span><del>-                51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */; };
</del><span class="cx">                 51B3005112529D0E000B5CA0 /* WebPageProxyCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */; };
</span><span class="cx">                 51BA24441858EE3000EA2811 /* AsyncTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 51BA24431858EE3000EA2811 /* AsyncTask.h */; };
</span><span class="cx">                 51BA24461858F55D00EA2811 /* WebCrossThreadCopier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51BA24451858F41500EA2811 /* WebCrossThreadCopier.cpp */; };
</span><span class="lines">@@ -2952,7 +2951,6 @@
</span><span class="cx">                 51ACC9351628064800342550 /* NetworkProcessMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkProcessMessages.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51B15A8213843A3900321AD8 /* EnvironmentUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EnvironmentUtilities.cpp; path = unix/EnvironmentUtilities.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51B15A8313843A3900321AD8 /* EnvironmentUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnvironmentUtilities.h; path = unix/EnvironmentUtilities.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebBackForwardListCF.cpp; path = cf/WebBackForwardListCF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPageProxyCF.cpp; path = cf/WebPageProxyCF.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51BA24431858EE3000EA2811 /* AsyncTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AsyncTask.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51BA24451858F41500EA2811 /* WebCrossThreadCopier.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebCrossThreadCopier.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5379,7 +5377,6 @@
</span><span class="cx">                 51B3004D12529CF5000B5CA0 /* cf */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                51B3004E12529D0E000B5CA0 /* WebBackForwardListCF.cpp */,
</del><span class="cx">                                 51B3004F12529D0E000B5CA0 /* WebPageProxyCF.cpp */,
</span><span class="cx">                         );
</span><span class="cx">                         name = cf;
</span><span class="lines">@@ -9065,7 +9062,6 @@
</span><span class="cx">                                 512A9769180E09B80039A149 /* DatabaseProcessProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 C5E1AFEE16B21025006CC1F2 /* APIWebArchiveResource.cpp in Sources */,
</span><span class="cx">                                 BC72BA1D11E64907001EB4EA /* WebBackForwardList.cpp in Sources */,
</span><del>-                                51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */,
</del><span class="cx">                                 1AC133741857C21E00F3EC05 /* APIGeometry.cpp in Sources */,
</span><span class="cx">                                 518D2CAD12D5153B003BB93B /* WebBackForwardListItem.cpp in Sources */,
</span><span class="cx">                                 BC72B9FA11E6476B001EB4EA /* WebBackForwardListProxy.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>