<!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>[170779] 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/170779">170779</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-07-03 17:08:36 -0700 (Thu, 03 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Try to fix the iOS build.

Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.

* UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
(WebKit::autosaveKey):
(WebKit::WebPageProxy::saveRecentSearches):
(WebKit::WebPageProxy::loadRecentSearches):
* UIProcess/mac/WebPageProxyMac.mm:
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWebPageProxyMacmm">trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebPageProxyCocoamm">trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (170778 => 170779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-07-03 23:47:59 UTC (rev 170778)
+++ trunk/Source/WebKit2/ChangeLog        2014-07-04 00:08:36 UTC (rev 170779)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-07-03  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Try to fix the iOS build.
+
+        Add WebPageProxyCocoa.mm for code shared between iOS and OS X. Put the recent searches save/restore code there.
+
+        * UIProcess/Cocoa/WebPageProxyCocoa.mm: Added.
+        (WebKit::autosaveKey):
+        (WebKit::WebPageProxy::saveRecentSearches):
+        (WebKit::WebPageProxy::loadRecentSearches):
+        * UIProcess/mac/WebPageProxyMac.mm:
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-07-03  Dan Bernstein  &lt;mitz@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         &lt;rdar://problem/16337741&gt; The UI process needs to track the number of HTTP subresource loads in progress (or at least whether there are any)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebPageProxyCocoamm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm (0 => 170779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebPageProxyCocoa.mm        2014-07-04 00:08:36 UTC (rev 170779)
</span><span class="lines">@@ -0,0 +1,75 @@
</span><ins>+/*
+ * Copyright (C) 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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WebProcessProxy.h&quot;
+
+#import &lt;wtf/cf/TypeCasts.h&gt;
+
+namespace WebKit {
+
+static RetainPtr&lt;CFStringRef&gt; autosaveKey(const String&amp; name)
+{
+    return String(&quot;com.apple.WebKit.searchField:&quot; + name).createCFString();
+}
+
+void WebPageProxy::saveRecentSearches(const String&amp; name, const Vector&lt;String&gt;&amp; searchItems)
+{
+    if (!name) {
+        // FIXME: This should be a message check.
+        return;
+    }
+
+    RetainPtr&lt;CFMutableArrayRef&gt; items;
+
+    if (!searchItems.isEmpty()) {
+        items = adoptCF(CFArrayCreateMutable(0, searchItems.size(), &amp;kCFTypeArrayCallBacks));
+
+        for (const auto&amp; searchItem : searchItems)
+            CFArrayAppendValue(items.get(), searchItem.createCFString().get());
+    }
+
+    CFPreferencesSetAppValue(autosaveKey(name).get(), items.get(), kCFPreferencesCurrentApplication);
+    CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
+}
+
+void WebPageProxy::loadRecentSearches(const String&amp; name, Vector&lt;String&gt;&amp; searchItems)
+{
+    if (!name) {
+        // FIXME: This should be a message check.
+        return;
+    }
+
+    auto items = adoptCF(dynamic_cf_cast&lt;CFArrayRef&gt;(CFPreferencesCopyAppValue(autosaveKey(name).get(), kCFPreferencesCurrentApplication)));
+    if (!items)
+        return;
+
+    for (size_t i = 0, size = CFArrayGetCount(items.get()); i &lt; size; ++i) {
+        if (auto item = dynamic_cf_cast&lt;CFStringRef&gt;(CFArrayGetValueAtIndex(items.get(), i)))
+            searchItems.append(item);
+    }
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWebPageProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (170778 => 170779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm        2014-07-03 23:47:59 UTC (rev 170778)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm        2014-07-04 00:08:36 UTC (rev 170779)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> #import &lt;WebKitSystemInterface.h&gt;
</span><span class="cx"> #import &lt;mach-o/dyld.h&gt;
</span><span class="cx"> #import &lt;wtf/NeverDestroyed.h&gt;
</span><del>-#import &lt;wtf/cf/TypeCasts.h&gt;
</del><span class="cx"> #import &lt;wtf/text/StringConcatenate.h&gt;
</span><span class="cx"> 
</span><span class="cx"> @interface NSApplication (Details)
</span><span class="lines">@@ -645,48 +644,6 @@
</span><span class="cx">     [[NSWorkspace sharedWorkspace] openFile:pdfFilename];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RetainPtr&lt;CFStringRef&gt; autosaveKey(const String&amp; name)
-{
-    return String(&quot;com.apple.WebKit.searchField:&quot; + name).createCFString();
-}
-
-void WebPageProxy::saveRecentSearches(const String&amp; name, const Vector&lt;String&gt;&amp; searchItems)
-{
-    if (!name) {
-        // FIXME: This should be a message check.
-        return;
-    }
-
-    RetainPtr&lt;CFMutableArrayRef&gt; items;
-
-    if (!searchItems.isEmpty()) {
-        items = adoptCF(CFArrayCreateMutable(0, searchItems.size(), &amp;kCFTypeArrayCallBacks));
-
-        for (const auto&amp; searchItem : searchItems)
-            CFArrayAppendValue(items.get(), searchItem.createCFString().get());
-    }
-
-    CFPreferencesSetAppValue(autosaveKey(name).get(), items.get(), kCFPreferencesCurrentApplication);
-    CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
-}
-
-void WebPageProxy::loadRecentSearches(const String&amp; name, Vector&lt;String&gt;&amp; searchItems)
-{
-    if (!name) {
-        // FIXME: This should be a message check.
-        return;
-    }
-
-    auto items = adoptCF(dynamic_cf_cast&lt;CFArrayRef&gt;(CFPreferencesCopyAppValue(autosaveKey(name).get(), kCFPreferencesCurrentApplication)));
-    if (!items)
-        return;
-
-    for (size_t i = 0, size = CFArrayGetCount(items.get()); i &lt; size; ++i) {
-        if (auto item = dynamic_cf_cast&lt;CFStringRef&gt;(CFArrayGetValueAtIndex(items.get(), i)))
-            searchItems.append(item);
-    }
-}
-
</del><span class="cx"> #if ENABLE(TELEPHONE_NUMBER_DETECTION)
</span><span class="cx"> void WebPageProxy::showTelephoneNumberMenu(const String&amp; telephoneNumber, const WebCore::IntPoint&amp; point)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (170778 => 170779)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-07-03 23:47:59 UTC (rev 170778)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-07-04 00:08:36 UTC (rev 170779)
</span><span class="lines">@@ -378,6 +378,7 @@
</span><span class="cx">                 1ABC3DF51899E437004F0626 /* NavigationState.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ABC3DF31899E437004F0626 /* NavigationState.mm */; };
</span><span class="cx">                 1ABC3DF61899E437004F0626 /* NavigationState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABC3DF41899E437004F0626 /* NavigationState.h */; };
</span><span class="cx">                 1ABC3DFC1899F51C004F0626 /* WKNavigationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ABC3DFB1899F51C004F0626 /* WKNavigationDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
</span><ins>+                1AC0273F196622D600C12B75 /* WebPageProxyCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AC0273E196622D600C12B75 /* WebPageProxyCocoa.mm */; };
</ins><span class="cx">                 1AC1336718565B5700F3EC05 /* UserData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC1336518565B5700F3EC05 /* UserData.cpp */; };
</span><span class="cx">                 1AC1336818565B5700F3EC05 /* UserData.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC1336618565B5700F3EC05 /* UserData.h */; };
</span><span class="cx">                 1AC1336C18565C7A00F3EC05 /* APIPageHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AC1336B18565C7A00F3EC05 /* APIPageHandle.h */; };
</span><span class="lines">@@ -2334,6 +2335,7 @@
</span><span class="cx">                 1ABC3DF31899E437004F0626 /* NavigationState.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NavigationState.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1ABC3DF41899E437004F0626 /* NavigationState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigationState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1ABC3DFB1899F51C004F0626 /* WKNavigationDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1AC0273E196622D600C12B75 /* WebPageProxyCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPageProxyCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1AC1336518565B5700F3EC05 /* UserData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AC1336618565B5700F3EC05 /* UserData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AC1336B18565C7A00F3EC05 /* APIPageHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIPageHandle.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4579,6 +4581,7 @@
</span><span class="cx">                                 2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */,
</span><span class="cx">                                 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */,
</span><span class="cx">                                 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */,
</span><ins>+                                1AC0273E196622D600C12B75 /* WebPageProxyCocoa.mm */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = Cocoa;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -8943,6 +8946,7 @@
</span><span class="cx">                                 0F0C365E18C110A500F607D7 /* LayerRepresentation.mm in Sources */,
</span><span class="cx">                                 1A043CEB124FE38F00FFBFB5 /* PluginProcessMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A0EC75F124BC7B2007EF4A5 /* PluginProcessProxy.cpp in Sources */,
</span><ins>+                                1AC0273F196622D600C12B75 /* WebPageProxyCocoa.mm in Sources */,
</ins><span class="cx">                                 1A2D90BB1281C931001EB962 /* PluginProcessProxyMac.mm in Sources */,
</span><span class="cx">                                 1A043B5D124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A043DC2124FF87500FFBFB5 /* PluginProxy.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>