<!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>[166385] 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/166385">166385</a></dd>
<dt>Author</dt> <dd>psolanki@apple.com</dd>
<dt>Date</dt> <dd>2014-03-27 16:46:32 -0700 (Thu, 27 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS WebKit2] Share network process code between iOS and Mac
https://bugs.webkit.org/show_bug.cgi?id=130861

Reviewed by Sam Weinig.

Implement network process functions for iOS by moving common code from NetworkProcessMac.mm
to a new shared file NetworkProcessCocoa.mm and sharing between iOS and Mac.

* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm: Added.
(WebKit::NetworkProcess::platformLowMemoryHandler):
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
Common initialization code for iOS and Mac.
(WebKit::memorySize):
(WebKit::volumeFreeSize):
(WebKit::NetworkProcess::platformSetCacheModel):
* NetworkProcess/ios/NetworkProcessIOS.mm:
(WebKit::NetworkProcess::initializeProcess):
Remove unnecessary #if PLATFORM(IOS).
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessiosNetworkProcessIOSmm">trunk/Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessmacNetworkProcessMacmm">trunk/Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebKit2/NetworkProcess/cocoa/</li>
<li><a href="#trunkSourceWebKit2NetworkProcesscocoaNetworkProcessCocoamm">trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (166384 => 166385)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-03-27 23:41:46 UTC (rev 166384)
+++ trunk/Source/WebKit2/ChangeLog        2014-03-27 23:46:32 UTC (rev 166385)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2014-03-27  Pratik Solanki  &lt;psolanki@apple.com&gt;
+
+        [iOS WebKit2] Share network process code between iOS and Mac
+        https://bugs.webkit.org/show_bug.cgi?id=130861
+
+        Reviewed by Sam Weinig.
+
+        Implement network process functions for iOS by moving common code from NetworkProcessMac.mm
+        to a new shared file NetworkProcessCocoa.mm and sharing between iOS and Mac.
+
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/cocoa/NetworkProcessCocoa.mm: Added.
+        (WebKit::NetworkProcess::platformLowMemoryHandler):
+        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
+        Common initialization code for iOS and Mac.
+        (WebKit::memorySize):
+        (WebKit::volumeFreeSize):
+        (WebKit::NetworkProcess::platformSetCacheModel):
+        * NetworkProcess/ios/NetworkProcessIOS.mm:
+        (WebKit::NetworkProcess::initializeProcess):
+        Remove unnecessary #if PLATFORM(IOS).
+        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
+        * NetworkProcess/mac/NetworkProcessMac.mm:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcess):
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-03-27  Enrica Casucci  &lt;enrica@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add support for AirPlay picker in WK2 for iOS.
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (166384 => 166385)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2014-03-27 23:41:46 UTC (rev 166384)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2014-03-27 23:46:32 UTC (rev 166385)
</span><span class="lines">@@ -138,6 +138,8 @@
</span><span class="cx">     NetworkProcessSupplementMap m_supplements;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><ins>+    void platformInitializeNetworkProcessCocoa(const NetworkProcessCreationParameters&amp;);
+
</ins><span class="cx">     // FIXME: We'd like to be able to do this without the #ifdef, but WorkQueue + BinarySemaphore isn't good enough since
</span><span class="cx">     // multiple requests to clear the cache can come in before previous requests complete, and we need to wait for all of them.
</span><span class="cx">     // In the future using WorkQueue and a counting semaphore would work, as would WorkQueue supporting the libdispatch concept of &quot;work groups&quot;.
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscocoaNetworkProcessCocoamm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm (0 => 166385)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm        2014-03-27 23:46:32 UTC (rev 166385)
</span><span class="lines">@@ -0,0 +1,125 @@
</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;NetworkProcess.h&quot;
+
+#if ENABLE(NETWORK_PROCESS)
+
+#import &quot;NetworkProcessCreationParameters.h&quot;
+#import &quot;NetworkResourceLoader.h&quot;
+#import &quot;SandboxExtension.h&quot;
+#import &lt;mach/host_info.h&gt;
+#import &lt;mach/mach.h&gt;
+#import &lt;mach/mach_error.h&gt;
+
+typedef const struct _CFURLCache* CFURLCacheRef;
+extern &quot;C&quot; CFURLCacheRef CFURLCacheCopySharedURLCache();
+extern &quot;C&quot; void _CFURLCachePurgeMemoryCache(CFURLCacheRef);
+
+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
+extern &quot;C&quot; void _CFURLCacheSetMinSizeForVMCachedResource(CFURLCacheRef, CFIndex);
+#endif
+
+namespace WebKit {
+
+void NetworkProcess::platformLowMemoryHandler(bool)
+{
+    _CFURLCachePurgeMemoryCache(adoptCF(CFURLCacheCopySharedURLCache()).get());
+}
+
+void NetworkProcess::platformInitializeNetworkProcessCocoa(const NetworkProcessCreationParameters&amp; parameters)
+{
+    m_diskCacheDirectory = parameters.diskCacheDirectory;
+
+    if (!m_diskCacheDirectory.isNull()) {
+        SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
+        [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc]
+            initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity
+            diskCapacity:parameters.nsURLCacheDiskCapacity
+            diskPath:parameters.diskCacheDirectory]).get()];
+    }
+
+#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
+    RetainPtr&lt;CFURLCacheRef&gt; cache = adoptCF(CFURLCacheCopySharedURLCache());
+    if (!cache)
+        return;
+
+    _CFURLCacheSetMinSizeForVMCachedResource(cache.get(), NetworkResourceLoader::fileBackedResourceMinimumSize());
+#endif
+}
+
+static uint64_t memorySize()
+{
+    static host_basic_info_data_t hostInfo;
+
+    static dispatch_once_t once;
+    dispatch_once(&amp;once, ^() {
+        mach_port_t host = mach_host_self();
+        mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
+        kern_return_t r = host_info(host, HOST_BASIC_INFO, (host_info_t)&amp;hostInfo, &amp;count);
+        mach_port_deallocate(mach_task_self(), host);
+
+        if (r != KERN_SUCCESS)
+            LOG_ERROR(&quot;%s : host_info(%d) : %s.\n&quot;, __FUNCTION__, r, mach_error_string(r));
+    });
+
+    return hostInfo.max_mem;
+}
+
+static uint64_t volumeFreeSize(const String&amp; path)
+{
+    NSDictionary *fileSystemAttributesDictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:(NSString *)path error:NULL];
+    return [[fileSystemAttributesDictionary objectForKey:NSFileSystemFreeSize] unsignedLongLongValue];
+}
+
+void NetworkProcess::platformSetCacheModel(CacheModel cacheModel)
+{
+    // As a fudge factor, use 1000 instead of 1024, in case the reported byte
+    // count doesn't align exactly to a megabyte boundary.
+    uint64_t memSize = memorySize() / 1024 / 1000;
+    uint64_t diskFreeSize = volumeFreeSize(m_diskCacheDirectory) / 1024 / 1000;
+
+    unsigned cacheTotalCapacity = 0;
+    unsigned cacheMinDeadCapacity = 0;
+    unsigned cacheMaxDeadCapacity = 0;
+    double deadDecodedDataDeletionInterval = 0;
+    unsigned pageCacheCapacity = 0;
+    unsigned long urlCacheMemoryCapacity = 0;
+    unsigned long urlCacheDiskCapacity = 0;
+
+    calculateCacheSizes(cacheModel, memSize, diskFreeSize,
+        cacheTotalCapacity, cacheMinDeadCapacity, cacheMaxDeadCapacity, deadDecodedDataDeletionInterval,
+        pageCacheCapacity, urlCacheMemoryCapacity, urlCacheDiskCapacity);
+
+
+    NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
+    [nsurlCache setMemoryCapacity:urlCacheMemoryCapacity];
+    [nsurlCache setDiskCapacity:std::max&lt;unsigned long&gt;(urlCacheDiskCapacity, [nsurlCache diskCapacity])]; // Don't shrink a big disk cache, since that would cause churn.
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessiosNetworkProcessIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm (166384 => 166385)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm        2014-03-27 23:41:46 UTC (rev 166384)
+++ trunk/Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm        2014-03-27 23:46:32 UTC (rev 166385)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS) &amp;&amp; ENABLE(NETWORK_PROCESS)
</span><span class="cx"> 
</span><ins>+#import &quot;NetworkProcessCreationParameters.h&quot;
</ins><span class="cx"> #import &lt;WebCore/CertificateInfo.h&gt;
</span><span class="cx"> #import &lt;WebCore/NotImplemented.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreThreadSystemInterface.h&gt;
</span><span class="lines">@@ -42,9 +43,7 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcess::initializeProcess(const ChildProcessInitializationParameters&amp;)
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
</del><span class="cx">     InitWebCoreThreadSystemInterface();
</span><del>-#endif // PLATFORM(IOS)
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcess::initializeProcessName(const ChildProcessInitializationParameters&amp;)
</span><span class="lines">@@ -57,11 +56,6 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcess::platformSetCacheModel(CacheModel)
-{
-    notImplemented();
-}
-
</del><span class="cx"> void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo&amp; certificateInfo, const String&amp; host)
</span><span class="cx"> {
</span><span class="cx">     [NSURLRequest setAllowsSpecificHTTPSCertificate:(NSArray *)certificateInfo.certificateChain() forHost:host];
</span><span class="lines">@@ -71,16 +65,11 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcess::platformLowMemoryHandler(bool)
</del><ins>+void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters&amp; parameters)
</ins><span class="cx"> {
</span><del>-    notImplemented();
</del><ins>+    platformInitializeNetworkProcessCocoa(parameters);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters&amp;)
-{
-    notImplemented();
-}
-
</del><span class="cx"> void NetworkProcess::platformTerminate()
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkProcessMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm (166384 => 166385)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm        2014-03-27 23:41:46 UTC (rev 166384)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm        2014-03-27 23:46:32 UTC (rev 166385)
</span><span class="lines">@@ -40,21 +40,10 @@
</span><span class="cx"> #import &lt;WebCore/LocalizedStrings.h&gt;
</span><span class="cx"> #import &lt;WebCore/MemoryPressureHandler.h&gt;
</span><span class="cx"> #import &lt;WebKitSystemInterface.h&gt;
</span><del>-#import &lt;mach/host_info.h&gt;
-#import &lt;mach/mach.h&gt;
-#import &lt;mach/mach_error.h&gt;
</del><span class="cx"> #import &lt;notify.h&gt;
</span><span class="cx"> #import &lt;sysexits.h&gt;
</span><span class="cx"> #import &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><del>-typedef struct _CFURLCache* CFURLCacheRef;
-extern &quot;C&quot; CFURLCacheRef CFURLCacheCopySharedURLCache();
-extern &quot;C&quot; void _CFURLCachePurgeMemoryCache(CFURLCacheRef);
-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
-extern &quot;C&quot; void _CFURLCacheSetMinSizeForVMCachedResource(CFURLCacheRef, CFIndex);
-#endif
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> @interface NSURLRequest (Details) 
</span><span class="lines">@@ -108,89 +97,18 @@
</span><span class="cx">         WKCFNetworkSetOverrideSystemProxySettings((CFDictionaryRef)proxySettings);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkProcess::platformLowMemoryHandler(bool)
-{
-    _CFURLCachePurgeMemoryCache(adoptCF(CFURLCacheCopySharedURLCache()).get());
-}
-
</del><span class="cx"> void NetworkProcess::platformInitializeNetworkProcess(const NetworkProcessCreationParameters&amp; parameters)
</span><span class="cx"> {
</span><del>-    m_diskCacheDirectory = parameters.diskCacheDirectory;
</del><ins>+    platformInitializeNetworkProcessCocoa(parameters);
</ins><span class="cx"> 
</span><del>-    if (!m_diskCacheDirectory.isNull()) {
-        SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle);
-        [NSURLCache setSharedURLCache:adoptNS([[NSURLCache alloc]
-            initWithMemoryCapacity:parameters.nsURLCacheMemoryCapacity
-            diskCapacity:parameters.nsURLCacheDiskCapacity
-            diskPath:parameters.diskCacheDirectory]).get()];
-    }
-
</del><span class="cx"> #if ENABLE(SEC_ITEM_SHIM)
</span><span class="cx">     SecItemShim::shared().initialize(this);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (!parameters.httpProxy.isNull() || !parameters.httpsProxy.isNull())
</span><span class="cx">         overrideSystemProxies(parameters.httpProxy, parameters.httpsProxy);
</span><del>-
-#if __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
-    RetainPtr&lt;CFURLCacheRef&gt; cache = adoptCF(CFURLCacheCopySharedURLCache());
-    if (!cache)
-        return;
-
-    _CFURLCacheSetMinSizeForVMCachedResource(cache.get(), NetworkResourceLoader::fileBackedResourceMinimumSize());
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-static uint64_t memorySize()
-{
-    static host_basic_info_data_t hostInfo;
-
-    static dispatch_once_t once;
-    dispatch_once(&amp;once, ^() {
-        mach_port_t host = mach_host_self();
-        mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
-        kern_return_t r = host_info(host, HOST_BASIC_INFO, (host_info_t)&amp;hostInfo, &amp;count);
-        mach_port_deallocate(mach_task_self(), host);
-
-        if (r != KERN_SUCCESS)
-            LOG_ERROR(&quot;%s : host_info(%d) : %s.\n&quot;, __FUNCTION__, r, mach_error_string(r));
-    });
-
-    return hostInfo.max_mem;
-}
-
-static uint64_t volumeFreeSize(const String&amp; path)
-{
-    NSDictionary *fileSystemAttributesDictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:(NSString *)path error:NULL];
-    return [[fileSystemAttributesDictionary objectForKey:NSFileSystemFreeSize] unsignedLongLongValue];
-}
-
-void NetworkProcess::platformSetCacheModel(CacheModel cacheModel)
-{
-
-    // As a fudge factor, use 1000 instead of 1024, in case the reported byte 
-    // count doesn't align exactly to a megabyte boundary.
-    uint64_t memSize = memorySize() / 1024 / 1000;
-    uint64_t diskFreeSize = volumeFreeSize(m_diskCacheDirectory) / 1024 / 1000;
-
-    unsigned cacheTotalCapacity = 0;
-    unsigned cacheMinDeadCapacity = 0;
-    unsigned cacheMaxDeadCapacity = 0;
-    double deadDecodedDataDeletionInterval = 0;
-    unsigned pageCacheCapacity = 0;
-    unsigned long urlCacheMemoryCapacity = 0;
-    unsigned long urlCacheDiskCapacity = 0;
-
-    calculateCacheSizes(cacheModel, memSize, diskFreeSize,
-        cacheTotalCapacity, cacheMinDeadCapacity, cacheMaxDeadCapacity, deadDecodedDataDeletionInterval,
-        pageCacheCapacity, urlCacheMemoryCapacity, urlCacheDiskCapacity);
-
-
-    NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
-    [nsurlCache setMemoryCapacity:urlCacheMemoryCapacity];
-    [nsurlCache setDiskCapacity:std::max&lt;unsigned long&gt;(urlCacheDiskCapacity, [nsurlCache diskCapacity])]; // Don't shrink a big disk cache, since that would cause churn.
-}
-
</del><span class="cx"> void NetworkProcess::allowSpecificHTTPSCertificateForHost(const CertificateInfo&amp; certificateInfo, const String&amp; host)
</span><span class="cx"> {
</span><span class="cx">     [NSURLRequest setAllowsSpecificHTTPSCertificate:(NSArray *)certificateInfo.certificateChain() forHost:(NSString *)host];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (166384 => 166385)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-03-27 23:41:46 UTC (rev 166384)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-03-27 23:46:32 UTC (rev 166385)
</span><span class="lines">@@ -971,6 +971,7 @@
</span><span class="cx">                 7CF47FFB17275C57008ACB91 /* PageBanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CF47FF917275C57008ACB91 /* PageBanner.h */; };
</span><span class="cx">                 7CF47FFE17276AE3008ACB91 /* WKBundlePageBannerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7CF47FFC17276AE3008ACB91 /* WKBundlePageBannerMac.mm */; };
</span><span class="cx">                 7CF47FFF17276AE3008ACB91 /* WKBundlePageBannerMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                7EC4F0FB18E4ACBB008056AF /* NetworkProcessCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EC4F0F918E4A945008056AF /* NetworkProcessCocoa.mm */; };
</ins><span class="cx">                 84477853176FCC0800CDC7BB /* InjectedBundleHitTestResultMediaType.h in Headers */ = {isa = PBXBuildFile; fileRef = 84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */; };
</span><span class="cx">                 868160D0187645570021E79D /* WindowServerConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 868160CF187645370021E79D /* WindowServerConnection.mm */; };
</span><span class="cx">                 8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CFECE931490F140002AAA32 /* EditorState.cpp */; };
</span><span class="lines">@@ -2808,6 +2809,7 @@
</span><span class="cx">                 7CF47FF917275C57008ACB91 /* PageBanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageBanner.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CF47FFC17276AE3008ACB91 /* WKBundlePageBannerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKBundlePageBannerMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7CF47FFD17276AE3008ACB91 /* WKBundlePageBannerMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePageBannerMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7EC4F0F918E4A945008056AF /* NetworkProcessCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = NetworkProcessCocoa.mm; path = NetworkProcess/cocoa/NetworkProcessCocoa.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleHitTestResultMediaType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 868160CD18763D4B0021E79D /* WindowServerConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WindowServerConnection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 868160CF187645370021E79D /* WindowServerConnection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowServerConnection.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4749,6 +4751,7 @@
</span><span class="cx">                 510CC7DA16138E0100D03ED3 /* NetworkProcess */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                7EC4F0F818E4A922008056AF /* cocoa */,
</ins><span class="cx">                                 2DA944BB188511DD00ED86DB /* ios */,
</span><span class="cx">                                 BC82837C16B45DA500A278FE /* EntryPoint */,
</span><span class="cx">                                 E1798C7616E6815500240139 /* FileAPI */,
</span><span class="lines">@@ -5138,6 +5141,14 @@
</span><span class="cx">                         path = Resources/PlugInSandboxProfiles;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="cx">                 };
</span><ins>+                7EC4F0F818E4A922008056AF /* cocoa */ = {
+                        isa = PBXGroup;
+                        children = (
+                                7EC4F0F918E4A945008056AF /* NetworkProcessCocoa.mm */,
+                        );
+                        name = cocoa;
+                        sourceTree = &quot;&lt;group&gt;&quot;;
+                };
</ins><span class="cx">                 9394AE411702B25B00344232 /* mac */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -8458,6 +8469,7 @@
</span><span class="cx">                                 BC857FB612B830E600EDEB2E /* WebOpenPanelParameters.cpp in Sources */,
</span><span class="cx">                                 BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */,
</span><span class="cx">                                 1AFDD3191891CA1200153970 /* WKPreferences.mm in Sources */,
</span><ins>+                                7EC4F0FB18E4ACBB008056AF /* NetworkProcessCocoa.mm in Sources */,
</ins><span class="cx">                                 511D8201185BC217001AED56 /* SQLiteIDBTransaction.cpp in Sources */,
</span><span class="cx">                                 2DA944BD188511E700ED86DB /* NetworkProcessIOS.mm in Sources */,
</span><span class="cx">                                 BC857F7E12B82CEE00EDEB2E /* WebOpenPanelResultListenerProxy.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>