<!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>[195005] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/195005">195005</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-01-13 18:43:48 -0800 (Wed, 13 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement custom protocols when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=153078

Patch by Alex Christensen &lt;achristensen@webkit.org&gt; on 2016-01-13
Reviewed by Andy Estes.

Source/WebCore:

No new tests, but this makes the WebKit2CustomProtocolsTest api tests pass when using NetworkSession.

* WebCore.xcodeproj/project.pbxproj:
Make NSURLConnectionSPI.h private so we can include it from within WebKit2.

Source/WebKit2:

* NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
(WebKit::generateCustomProtocolID):
(+[WKCustomProtocol canInitWithRequest:]):
(+[WKCustomProtocol canonicalRequestForRequest:]):
(-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
(-[WKCustomProtocol startLoading]):
(-[WKCustomProtocol stopLoading]):
There's no need to have a static pointer when we can use NetworkProcess::singleton to access
the process-global CustomProtocolManager, and add null checks because that's a good thing to do.
(WebKit::CustomProtocolManager::CustomProtocolManager):
Call UTF8Encoding when creating the CustomProtocolManager on the main thread to make sure it exists
for when we decode URLS in ResourceResponses from IPC later, which is done on a different WorkQueue.
(WebKit::CustomProtocolManager::initializeConnection):
(WebKit::CustomProtocolManager::initialize):
(WebKit::CustomProtocolManager::removeCustomProtocol):
(WebKit::CustomProtocolManager::registerProtocolClass):
(WebKit::CustomProtocolManager::registerScheme):
* NetworkProcess/CustomProtocols/CustomProtocolManager.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSession::NetworkSession):
Call registerProtocolClass to set configuration.protocolClasses if there is a CustomProtocolManager.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessCustomProtocolsCocoaCustomProtocolManagerCocoamm">trunk/Source/WebKit2/NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessCustomProtocolsCustomProtocolManagerh">trunk/Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscocoaNetworkSessionCocoamm">trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195004 => 195005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-14 01:29:17 UTC (rev 195004)
+++ trunk/Source/WebCore/ChangeLog        2016-01-14 02:43:48 UTC (rev 195005)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-13  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Implement custom protocols when using NetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=153078
+
+        Reviewed by Andy Estes.
+
+        No new tests, but this makes the WebKit2CustomProtocolsTest api tests pass when using NetworkSession.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Make NSURLConnectionSPI.h private so we can include it from within WebKit2.
+
</ins><span class="cx"> 2016-01-13  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Cross-protocol, cross-site scripting (XPSS) using HTML forms
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (195004 => 195005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-01-14 01:29:17 UTC (rev 195004)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-01-14 02:43:48 UTC (rev 195005)
</span><span class="lines">@@ -1336,7 +1336,7 @@
</span><span class="cx">                 31A795C71888BCB200382F90 /* ANGLEInstancedArrays.h in Headers */ = {isa = PBXBuildFile; fileRef = 31A795C21888B72400382F90 /* ANGLEInstancedArrays.h */; };
</span><span class="cx">                 31A795C81888BCB500382F90 /* ANGLEInstancedArrays.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31A795C11888B72400382F90 /* ANGLEInstancedArrays.cpp */; };
</span><span class="cx">                 31AB5000122878A2001A7DB0 /* GraphicsContext3DIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 31AB4FFF122878A2001A7DB0 /* GraphicsContext3DIOS.h */; };
</span><del>-                31B313DB1B69871600F2AABC /* NSURLConnectionSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31B313DA1B69871600F2AABC /* NSURLConnectionSPI.h */; };
</del><ins>+                31B313DB1B69871600F2AABC /* NSURLConnectionSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31B313DA1B69871600F2AABC /* NSURLConnectionSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 31B313DD1B6987DB00F2AABC /* NSURLRequestSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31B313DC1B6987DB00F2AABC /* NSURLRequestSPI.h */; };
</span><span class="cx">                 31B313DF1B6988C500F2AABC /* NSButtonCellSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31B313DE1B6988C500F2AABC /* NSButtonCellSPI.h */; };
</span><span class="cx">                 31BC742D1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31BC742B1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp */; };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (195004 => 195005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-01-14 01:29:17 UTC (rev 195004)
+++ trunk/Source/WebKit2/ChangeLog        2016-01-14 02:43:48 UTC (rev 195005)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-01-13  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Implement custom protocols when using NetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=153078
+
+        Reviewed by Andy Estes.
+
+        * NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
+        (WebKit::generateCustomProtocolID):
+        (+[WKCustomProtocol canInitWithRequest:]):
+        (+[WKCustomProtocol canonicalRequestForRequest:]):
+        (-[WKCustomProtocol initWithRequest:cachedResponse:client:]):
+        (-[WKCustomProtocol startLoading]):
+        (-[WKCustomProtocol stopLoading]):
+        There's no need to have a static pointer when we can use NetworkProcess::singleton to access 
+        the process-global CustomProtocolManager, and add null checks because that's a good thing to do.
+        (WebKit::CustomProtocolManager::CustomProtocolManager):
+        Call UTF8Encoding when creating the CustomProtocolManager on the main thread to make sure it exists
+        for when we decode URLS in ResourceResponses from IPC later, which is done on a different WorkQueue.
+        (WebKit::CustomProtocolManager::initializeConnection):
+        (WebKit::CustomProtocolManager::initialize):
+        (WebKit::CustomProtocolManager::removeCustomProtocol):
+        (WebKit::CustomProtocolManager::registerProtocolClass):
+        (WebKit::CustomProtocolManager::registerScheme):
+        * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSession::NetworkSession):
+        Call registerProtocolClass to set configuration.protocolClasses if there is a CustomProtocolManager.
+
</ins><span class="cx"> 2016-01-13  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WK2: Request completion candidates when needed
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessCustomProtocolsCocoaCustomProtocolManagerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm (195004 => 195005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm        2016-01-14 01:29:17 UTC (rev 195004)
+++ trunk/Source/WebKit2/NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm        2016-01-14 02:43:48 UTC (rev 195005)
</span><span class="lines">@@ -30,30 +30,22 @@
</span><span class="cx"> #import &quot;CustomProtocolManagerMessages.h&quot;
</span><span class="cx"> #import &quot;CustomProtocolManagerProxyMessages.h&quot;
</span><span class="cx"> #import &quot;DataReference.h&quot;
</span><ins>+#import &quot;NetworkProcess.h&quot;
</ins><span class="cx"> #import &quot;NetworkProcessCreationParameters.h&quot;
</span><span class="cx"> #import &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #import &quot;WebProcessCreationParameters.h&quot;
</span><ins>+#import &lt;Foundation/NSURLSession.h&gt;
+#import &lt;WebCore/NSURLConnectionSPI.h&gt;
</ins><span class="cx"> #import &lt;WebCore/URL.h&gt;
</span><span class="cx"> #import &lt;WebCore/ResourceError.h&gt;
</span><span class="cx"> #import &lt;WebCore/ResourceRequest.h&gt;
</span><span class="cx"> #import &lt;WebCore/ResourceResponse.h&gt;
</span><ins>+#import &lt;WebCore/TextEncoding.h&gt;
</ins><span class="cx"> 
</span><del>-#ifdef __has_include
-#if __has_include(&lt;Foundation/NSURLConnectionPrivate.h&gt;)
-#import &lt;Foundation/NSURLConnectionPrivate.h&gt;
-#endif
-#endif
-
-@interface NSURLConnection ()
-+ (CFRunLoopRef)resourceLoaderRunLoop;
-@end
-
</del><span class="cx"> using namespace WebKit;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-static CustomProtocolManager* sharedCustomProtocolManager;
-
</del><span class="cx"> static uint64_t generateCustomProtocolID()
</span><span class="cx"> {
</span><span class="cx">     static uint64_t uniqueCustomProtocolID = 0;
</span><span class="lines">@@ -75,7 +67,9 @@
</span><span class="cx"> 
</span><span class="cx"> + (BOOL)canInitWithRequest:(NSURLRequest *)request
</span><span class="cx"> {
</span><del>-    return sharedCustomProtocolManager-&gt;supportsScheme([[[request URL] scheme] lowercaseString]);
</del><ins>+    if (auto* customProtocolManager = NetworkProcess::singleton().supplement&lt;CustomProtocolManager&gt;())
+        return customProtocolManager-&gt;supportsScheme([[[request URL] scheme] lowercaseString]);
+    return NO;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> + (NSURLRequest *)canonicalRequestForRequest:(NSURLRequest *)request
</span><span class="lines">@@ -95,19 +89,23 @@
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><span class="cx">     _customProtocolID = generateCustomProtocolID();
</span><del>-    sharedCustomProtocolManager-&gt;addCustomProtocol(self);
</del><ins>+    if (auto* customProtocolManager = NetworkProcess::singleton().supplement&lt;CustomProtocolManager&gt;())
+        customProtocolManager-&gt;addCustomProtocol(self);
</ins><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)startLoading
</span><span class="cx"> {
</span><del>-    sharedCustomProtocolManager-&gt;childProcess()-&gt;send(Messages::CustomProtocolManagerProxy::StartLoading(self.customProtocolID, [self request]), 0);
</del><ins>+    if (auto* customProtocolManager = NetworkProcess::singleton().supplement&lt;CustomProtocolManager&gt;())
+        customProtocolManager-&gt;childProcess()-&gt;send(Messages::CustomProtocolManagerProxy::StartLoading(self.customProtocolID, [self request]), 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)stopLoading
</span><span class="cx"> {
</span><del>-    sharedCustomProtocolManager-&gt;childProcess()-&gt;send(Messages::CustomProtocolManagerProxy::StopLoading(self.customProtocolID), 0);
-    sharedCustomProtocolManager-&gt;removeCustomProtocol(self);
</del><ins>+    if (auto* customProtocolManager = NetworkProcess::singleton().supplement&lt;CustomProtocolManager&gt;()) {
+        customProtocolManager-&gt;childProcess()-&gt;send(Messages::CustomProtocolManagerProxy::StopLoading(self.customProtocolID), 0);
+        customProtocolManager-&gt;removeCustomProtocol(self);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="lines">@@ -123,8 +121,7 @@
</span><span class="cx">     : m_childProcess(childProcess)
</span><span class="cx">     , m_messageQueue(WorkQueue::create(&quot;com.apple.WebKit.CustomProtocolManager&quot;))
</span><span class="cx"> {
</span><del>-    ASSERT(!sharedCustomProtocolManager);
-    sharedCustomProtocolManager = this;
</del><ins>+    WebCore::UTF8Encoding();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CustomProtocolManager::initializeConnection(IPC::Connection* connection)
</span><span class="lines">@@ -134,7 +131,9 @@
</span><span class="cx"> 
</span><span class="cx"> void CustomProtocolManager::initialize(const NetworkProcessCreationParameters&amp; parameters)
</span><span class="cx"> {
</span><ins>+#if !USE(NETWORK_SESSION)
</ins><span class="cx">     [NSURLProtocol registerClass:[WKCustomProtocol class]];
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     for (size_t i = 0; i &lt; parameters.urlSchemesRegisteredForCustomProtocols.size(); ++i)
</span><span class="cx">         registerScheme(parameters.urlSchemesRegisteredForCustomProtocols[i]);
</span><span class="lines">@@ -153,7 +152,14 @@
</span><span class="cx">     LockHolder locker(m_customProtocolMapMutex);
</span><span class="cx">     m_customProtocolMap.remove(customProtocol.customProtocolID);
</span><span class="cx"> }
</span><del>-    
</del><ins>+
+#if USE(NETWORK_SESSION)
+void CustomProtocolManager::registerProtocolClass(NSURLSessionConfiguration *configuration)
+{
+    configuration.protocolClasses = @[[WKCustomProtocol class]];
+}
+#endif
+
</ins><span class="cx"> void CustomProtocolManager::registerScheme(const String&amp; scheme)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!scheme.isNull());
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessCustomProtocolsCustomProtocolManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.h (195004 => 195005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.h        2016-01-14 01:29:17 UTC (rev 195004)
+++ trunk/Source/WebKit2/NetworkProcess/CustomProtocols/CustomProtocolManager.h        2016-01-14 02:43:48 UTC (rev 195005)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><ins>+OBJC_CLASS NSURLSessionConfiguration;
</ins><span class="cx"> OBJC_CLASS WKCustomProtocol;
</span><span class="cx"> #else
</span><span class="cx"> #include &quot;CustomProtocolManagerImpl.h&quot;
</span><span class="lines">@@ -73,7 +74,10 @@
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     void addCustomProtocol(WKCustomProtocol *);
</span><span class="cx">     void removeCustomProtocol(WKCustomProtocol *);
</span><ins>+#if USE(NETWORK_SESSION)
+    void registerProtocolClass(NSURLSessionConfiguration *);
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // ChildProcessSupplement
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscocoaNetworkSessionCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm (195004 => 195005)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm        2016-01-14 01:29:17 UTC (rev 195004)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm        2016-01-14 02:43:48 UTC (rev 195005)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(NETWORK_SESSION)
</span><span class="cx"> 
</span><ins>+#import &quot;CustomProtocolManager.h&quot;
</ins><span class="cx"> #import &quot;Download.h&quot;
</span><span class="cx"> #import &quot;NetworkLoad.h&quot;
</span><span class="cx"> #import &quot;NetworkProcess.h&quot;
</span><span class="lines">@@ -207,6 +208,9 @@
</span><span class="cx"> 
</span><span class="cx">     NSURLSessionConfiguration *configuration = configurationForType(type);
</span><span class="cx"> 
</span><ins>+    if (auto* customProtocolManager = NetworkProcess::singleton().supplement&lt;CustomProtocolManager&gt;())
+        customProtocolManager-&gt;registerProtocolClass(configuration);
+    
</ins><span class="cx"> #if HAVE(TIMINGDATAOPTIONS)
</span><span class="cx">     configuration._timingDataOptions = _TimingDataOptionsEnableW3CNavigationTiming;
</span><span class="cx"> #else
</span></span></pre>
</div>
</div>

</body>
</html>