<!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>[174369] 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/174369">174369</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2014-10-06 15:07:24 -0700 (Mon, 06 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Mac] We are spending too much time serializing ProtectionSpace objects
https://bugs.webkit.org/show_bug.cgi?id=137367

Reviewed by Dan Bernstein.

When profiling the load of nytimes.com, I noticed that we were spending
a lot of CPU time serializing ProtectionSpace objects (in particular
the NSURLProtectionSpace platform data):
- 5.6% of CPU time for Network Process
- 2.5% of CPU time for WebProcess

Serializing an NSURLProtectionSpace seems to be costly due to server
trust verification. We do this for every sub-resource load over HTTPS
due to the canAuthenticateAgainstProtectionSpace() callback for server
trust validation, from the NetworkProcess to the WebProcess and then to
the UIProcess.

This patch adds a WKContextSetCanHandleHTTPSServerTrustEvaluation(bool)
WK2 private API that the client can call to indicate that it cannot
handle HTTPS server trust evaluation and that it is thus unnecessary to
call the canAuthenticateAgainstProtectionSpace() callback for such
evaluations. This reduces the amount of IPC between the process and
thus the number of times we have to serialize the ProtectionSpace.

In the case of the nytimes.com load, there is no longer any
ProtectionSpace serialization happening as
canAuthenticateAgainstProtectionSpace() was only called for HTTPS
server trust evaluation.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
(WebKit::NetworkProcess::initializeNetworkProcess):
(WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation):
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
* Shared/Network/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* Shared/Network/NetworkProcessCreationParameters.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextSetCanHandleHTTPSServerTrustEvaluation):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::WebContext):
(WebKit::WebContext::ensureNetworkProcess):
(WebKit::WebContext::setCanHandleHTTPSServerTrustEvaluation):
* UIProcess/WebContext.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessmessagesin">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedNetworkNetworkProcessCreationParameterscpp">trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedNetworkNetworkProcessCreationParametersh">trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKContextcpp">trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICWKContextPrivateh">trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebContextcpp">trunk/Source/WebKit2/UIProcess/WebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebContexth">trunk/Source/WebKit2/UIProcess/WebContext.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/ChangeLog        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -1,3 +1,59 @@
</span><ins>+2014-10-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [Mac] We are spending too much time serializing ProtectionSpace objects
+        https://bugs.webkit.org/show_bug.cgi?id=137367
+
+        Reviewed by Dan Bernstein.
+
+        When profiling the load of nytimes.com, I noticed that we were spending
+        a lot of CPU time serializing ProtectionSpace objects (in particular
+        the NSURLProtectionSpace platform data):
+        - 5.6% of CPU time for Network Process
+        - 2.5% of CPU time for WebProcess
+
+        Serializing an NSURLProtectionSpace seems to be costly due to server
+        trust verification. We do this for every sub-resource load over HTTPS
+        due to the canAuthenticateAgainstProtectionSpace() callback for server
+        trust validation, from the NetworkProcess to the WebProcess and then to
+        the UIProcess.
+
+        This patch adds a WKContextSetCanHandleHTTPSServerTrustEvaluation(bool)
+        WK2 private API that the client can call to indicate that it cannot
+        handle HTTPS server trust evaluation and that it is thus unnecessary to
+        call the canAuthenticateAgainstProtectionSpace() callback for such
+        evaluations. This reduces the amount of IPC between the process and
+        thus the number of times we have to serialize the ProtectionSpace.
+
+        In the case of the nytimes.com load, there is no longer any
+        ProtectionSpace serialization happening as
+        canAuthenticateAgainstProtectionSpace() was only called for HTTPS
+        server trust evaluation.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::NetworkProcess):
+        (WebKit::NetworkProcess::initializeNetworkProcess):
+        (WebKit::NetworkProcess::setCanHandleHTTPSServerTrustEvaluation):
+        * NetworkProcess/NetworkProcess.h:
+        (WebKit::NetworkProcess::canHandleHTTPSServerTrustEvaluation):
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
+        * Shared/Network/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * Shared/Network/NetworkProcessCreationParameters.h:
+        * UIProcess/API/C/WKContext.cpp:
+        (WKContextSetCanHandleHTTPSServerTrustEvaluation):
+        * UIProcess/API/C/WKContextPrivate.h:
+        * UIProcess/API/Cocoa/WKProcessPool.mm:
+        (-[WKProcessPool _setCanHandleHTTPSServerTrustEvaluation:]):
+        * UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::WebContext):
+        (WebKit::WebContext::ensureNetworkProcess):
+        (WebKit::WebContext::setCanHandleHTTPSServerTrustEvaluation):
+        * UIProcess/WebContext.h:
+
</ins><span class="cx"> 2014-10-06  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Don't attempt to paint into zero-sized backing store
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> NetworkProcess::NetworkProcess()
</span><span class="cx">     : m_hasSetCacheModel(false)
</span><span class="cx">     , m_cacheModel(CacheModelDocumentViewer)
</span><ins>+    , m_canHandleHTTPSServerTrustEvaluation(true)
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     , m_clearCacheDispatchGroup(0)
</span><span class="cx"> #endif
</span><span class="lines">@@ -163,6 +164,7 @@
</span><span class="cx">     memoryPressureHandler().install();
</span><span class="cx"> 
</span><span class="cx">     setCacheModel(static_cast&lt;uint32_t&gt;(parameters.cacheModel));
</span><ins>+    setCanHandleHTTPSServerTrustEvaluation(parameters.canHandleHTTPSServerTrustEvaluation);
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) || USE(CFNETWORK)
</span><span class="cx">     SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
</span><span class="lines">@@ -252,6 +254,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkProcess::setCanHandleHTTPSServerTrustEvaluation(bool value)
+{
+    m_canHandleHTTPSServerTrustEvaluation = value;
+}
+
</ins><span class="cx"> void NetworkProcess::getNetworkProcessStatistics(uint64_t callbackID)
</span><span class="cx"> {
</span><span class="cx">     NetworkResourceLoadScheduler&amp; scheduler = NetworkProcess::shared().networkResourceLoadScheduler();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx"> 
</span><span class="cx">     AuthenticationManager&amp; authenticationManager();
</span><span class="cx">     DownloadManager&amp; downloadManager();
</span><ins>+    bool canHandleHTTPSServerTrustEvaluation() const { return m_canHandleHTTPSServerTrustEvaluation; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     NetworkProcess();
</span><span class="lines">@@ -115,6 +116,7 @@
</span><span class="cx">     void cancelDownload(uint64_t downloadID);
</span><span class="cx">     void setCacheModel(uint32_t);
</span><span class="cx">     void allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo&amp;, const String&amp; host);
</span><ins>+    void setCanHandleHTTPSServerTrustEvaluation(bool);
</ins><span class="cx">     void getNetworkProcessStatistics(uint64_t callbackID);
</span><span class="cx">     void clearCacheForAllOrigins(uint32_t cachesToClear);
</span><span class="cx"> 
</span><span class="lines">@@ -134,6 +136,7 @@
</span><span class="cx">     String m_diskCacheDirectory;
</span><span class="cx">     bool m_hasSetCacheModel;
</span><span class="cx">     CacheModel m_cacheModel;
</span><ins>+    bool m_canHandleHTTPSServerTrustEvaluation;
</ins><span class="cx"> 
</span><span class="cx">     typedef HashMap&lt;const char*, std::unique_ptr&lt;NetworkProcessSupplement&gt;, PtrHash&lt;const char*&gt;&gt; NetworkProcessSupplementMap;
</span><span class="cx">     NetworkProcessSupplementMap m_supplements;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     AllowSpecificHTTPSCertificateForHost(WebCore::CertificateInfo certificate, String host)
</span><ins>+    SetCanHandleHTTPSServerTrustEvaluation(bool value)
</ins><span class="cx">     
</span><span class="cx">     GetNetworkProcessStatistics(uint64_t callbackID)
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -475,6 +475,13 @@
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><ins>+    // Handle server trust evaluation at platform-level if requested, for performance reasons.
+    if (protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
+        &amp;&amp; !NetworkProcess::shared().canHandleHTTPSServerTrustEvaluation()) {
+        continueCanAuthenticateAgainstProtectionSpace(false);
+        return;
+    }
+
</ins><span class="cx">     if (isSynchronous()) {
</span><span class="cx">         // FIXME: We should ask the WebProcess like the asynchronous case below does.
</span><span class="cx">         // This is currently impossible as the WebProcess is blocked waiting on this synchronous load.
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedNetworkNetworkProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.cpp        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> {
</span><span class="cx">     encoder &lt;&lt; privateBrowsingEnabled;
</span><span class="cx">     encoder.encodeEnum(cacheModel);
</span><ins>+    encoder &lt;&lt; canHandleHTTPSServerTrustEvaluation;
</ins><span class="cx">     encoder &lt;&lt; diskCacheDirectory;
</span><span class="cx">     encoder &lt;&lt; diskCacheDirectoryExtensionHandle;
</span><span class="cx">     encoder &lt;&lt; cookieStorageDirectory;
</span><span class="lines">@@ -75,6 +76,8 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decodeEnum(result.cacheModel))
</span><span class="cx">         return false;
</span><ins>+    if (!decoder.decode(result.canHandleHTTPSServerTrustEvaluation))
+        return false;
</ins><span class="cx">     if (!decoder.decode(result.diskCacheDirectory))
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(result.diskCacheDirectoryExtensionHandle))
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedNetworkNetworkProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/Shared/Network/NetworkProcessCreationParameters.h        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool privateBrowsingEnabled;
</span><span class="cx">     CacheModel cacheModel;
</span><ins>+    bool canHandleHTTPSServerTrustEvaluation;
</ins><span class="cx"> 
</span><span class="cx">     String diskCacheDirectory;
</span><span class="cx">     SandboxExtension::Handle diskCacheDirectoryExtensionHandle;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -385,6 +385,11 @@
</span><span class="cx">     toImpl(contextRef)-&gt;setDomainRelaxationForbiddenForURLScheme(toImpl(urlScheme)-&gt;string());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WKContextSetCanHandleHTTPSServerTrustEvaluation(WKContextRef contextRef, bool value)
+{
+    toImpl(contextRef)-&gt;setCanHandleHTTPSServerTrustEvaluation(value);
+}
+
</ins><span class="cx"> WKCookieManagerRef WKContextGetCookieManager(WKContextRef contextRef)
</span><span class="cx"> {
</span><span class="cx">     return toAPI(toImpl(contextRef)-&gt;supplement&lt;WebCookieManagerProxy&gt;());
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICWKContextPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -56,6 +56,8 @@
</span><span class="cx"> 
</span><span class="cx"> WK_EXPORT void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef context, WKStringRef urlScheme);
</span><span class="cx"> 
</span><ins>+WK_EXPORT void WKContextSetCanHandleHTTPSServerTrustEvaluation(WKContextRef context, bool value);
+
</ins><span class="cx"> WK_EXPORT void WKContextSetIconDatabasePath(WKContextRef context, WKStringRef iconDatabasePath);
</span><span class="cx"> 
</span><span class="cx"> WK_EXPORT void WKContextAllowSpecificHTTPSCertificateForHost(WKContextRef context, WKCertificateInfoRef certificate, WKStringRef host);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -197,6 +197,11 @@
</span><span class="cx">     _context-&gt;allowSpecificHTTPSCertificateForHost(WebKit::WebCertificateInfo::create(WebCore::CertificateInfo((CFArrayRef)certificateChain)).get(), host);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_setCanHandleHTTPSServerTrustEvaluation:(BOOL)value
+{
+    _context-&gt;setCanHandleHTTPSServerTrustEvaluation(value);
+}
+
</ins><span class="cx"> static WebKit::HTTPCookieAcceptPolicy toHTTPCookieAcceptPolicy(NSHTTPCookieAcceptPolicy policy)
</span><span class="cx"> {
</span><span class="cx">     switch (static_cast&lt;NSUInteger&gt;(policy)) {
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKProcessPoolPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> @property (nonatomic, readonly) _WKProcessPoolConfiguration *_configuration;
</span><span class="cx"> 
</span><span class="cx"> - (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host;
</span><ins>+- (void)_setCanHandleHTTPSServerTrustEvaluation:(BOOL)value;
</ins><span class="cx"> - (void)_setCookieAcceptPolicy:(NSHTTPCookieAcceptPolicy)policy;
</span><span class="cx"> 
</span><span class="cx"> - (id)_objectForBundleParameter:(NSString *)parameter;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.cpp        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -180,6 +180,7 @@
</span><span class="cx">     , m_shouldUseTestingNetworkSession(false)
</span><span class="cx">     , m_processTerminationEnabled(true)
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span><ins>+    , m_canHandleHTTPSServerTrustEvaluation(true)
</ins><span class="cx">     , m_usesNetworkProcess(false)
</span><span class="cx"> #endif
</span><span class="cx"> #if USE(SOUP)
</span><span class="lines">@@ -415,6 +416,7 @@
</span><span class="cx">     parameters.privateBrowsingEnabled = WebPreferences::anyPagesAreUsingPrivateBrowsing();
</span><span class="cx"> 
</span><span class="cx">     parameters.cacheModel = m_cacheModel;
</span><ins>+    parameters.canHandleHTTPSServerTrustEvaluation = m_canHandleHTTPSServerTrustEvaluation;
</ins><span class="cx"> 
</span><span class="cx">     parameters.diskCacheDirectory = stringByResolvingSymlinksInPath(diskCacheDirectory());
</span><span class="cx">     if (!parameters.diskCacheDirectory.isEmpty())
</span><span class="lines">@@ -980,6 +982,19 @@
</span><span class="cx">     sendToAllProcesses(Messages::WebProcess::SetDomainRelaxationForbiddenForURLScheme(urlScheme));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebContext::setCanHandleHTTPSServerTrustEvaluation(bool value)
+{
+#if ENABLE(NETWORK_PROCESS)
+    m_canHandleHTTPSServerTrustEvaluation = value;
+    if (m_usesNetworkProcess &amp;&amp; m_networkProcess) {
+        m_networkProcess-&gt;send(Messages::NetworkProcess::SetCanHandleHTTPSServerTrustEvaluation(value), 0);
+        return;
+    }
+#else
+    UNUSED_PARAM(value);
+#endif
+}
+
</ins><span class="cx"> void WebContext::registerURLSchemeAsLocal(const String&amp; urlScheme)
</span><span class="cx"> {
</span><span class="cx">     m_schemesToRegisterAsLocal.add(urlScheme);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (174368 => 174369)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebContext.h        2014-10-06 21:53:21 UTC (rev 174368)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h        2014-10-06 22:07:24 UTC (rev 174369)
</span><span class="lines">@@ -202,6 +202,7 @@
</span><span class="cx">     void registerURLSchemeAsEmptyDocument(const String&amp;);
</span><span class="cx">     void registerURLSchemeAsSecure(const String&amp;);
</span><span class="cx">     void setDomainRelaxationForbiddenForURLScheme(const String&amp;);
</span><ins>+    void setCanHandleHTTPSServerTrustEvaluation(bool);
</ins><span class="cx">     void registerURLSchemeAsLocal(const String&amp;);
</span><span class="cx">     void registerURLSchemeAsNoAccess(const String&amp;);
</span><span class="cx">     void registerURLSchemeAsDisplayIsolated(const String&amp;);
</span><span class="lines">@@ -535,6 +536,7 @@
</span><span class="cx">     bool m_processTerminationEnabled;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span><ins>+    bool m_canHandleHTTPSServerTrustEvaluation;
</ins><span class="cx">     bool m_usesNetworkProcess;
</span><span class="cx">     RefPtr&lt;NetworkProcessProxy&gt; m_networkProcess;
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>