<!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>[206604] 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/206604">206604</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2016-09-29 12:48:25 -0700 (Thu, 29 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
&lt;rdar://problem/27648683&gt;
https://bugs.webkit.org/show_bug.cgi?id=162735

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/spi/cf/CFNetworkSPI.h:
Forward declare _sourceApplicationSecondaryIdentifier and _CTDataConnectionServiceType

Source/WebKit2:

Add SPI for overriding the following NSURLSessionConfigurations properties:
    - _sourceApplicationBundleIdentifier
    - _sourceApplicationSecondaryIdentifier
    - _CTDataConnectionServiceType

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalSourceApplicationBundleIdentifier):
(WebKit::globalSourceApplicationSecondaryIdentifier):
(WebKit::globalCTDataConnectionServiceType):
(WebKit::NetworkSession::setCustomProtocolManager):
(WebKit::NetworkSession::setSourceApplicationAuditTokenData):
(WebKit::NetworkSession::setSourceApplicationBundleIdentifier):
(WebKit::NetworkSession::setSourceApplicationSecondaryIdentifier):
(WebKit::NetworkSession::setCTDataConnectionServiceType):
(WebKit::NetworkSession::NetworkSession):
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
(-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
(-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
(-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
(-[_WKProcessPoolConfiguration CTDataConnectionServiceType]):
(-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]):
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformspicfCFNetworkSPIh">trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h</a></li>
<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="#trunkSourceWebKit2NetworkProcessNetworkProcessCreationParameterscpp">trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessCreationParametersh">trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkSessionh">trunk/Source/WebKit2/NetworkProcess/NetworkSession.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscocoaNetworkProcessCocoamm">trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscocoaNetworkSessionCocoamm">trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationcpp">trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationh">trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKProcessPoolConfigurationh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKProcessPoolConfigurationmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWebProcessPoolCocoamm">trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm">trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebCore/ChangeLog        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-09-29  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
+        &lt;rdar://problem/27648683&gt;
+        https://bugs.webkit.org/show_bug.cgi?id=162735
+
+        Reviewed by Dan Bernstein.
+
+        * platform/spi/cf/CFNetworkSPI.h:
+        Forward declare _sourceApplicationSecondaryIdentifier and _CTDataConnectionServiceType
+
</ins><span class="cx"> 2016-09-29  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove addSubresourceStyleURLs functions
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicfCFNetworkSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -100,7 +100,11 @@
</span><span class="cx"> @interface NSURLSessionConfiguration ()
</span><span class="cx"> @property (assign) _TimingDataOptions _timingDataOptions;
</span><span class="cx"> @property (copy) NSData *_sourceApplicationAuditTokenData;
</span><del>-@property (copy) NSString *_sourceApplicationBundleIdentifier;
</del><ins>+@property (nullable, copy) NSString *_sourceApplicationBundleIdentifier;
+@property (nullable, copy) NSString *_sourceApplicationSecondaryIdentifier;
+#if PLATFORM(IOS)
+@property (nullable, copy) NSString *_CTDataConnectionServiceType;
+#endif
</ins><span class="cx"> @end
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/ChangeLog        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2016-09-29  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        Allow overriding some NSURLSessionConfiguration properties on a per-NetworkProcess basis
+        &lt;rdar://problem/27648683&gt;
+        https://bugs.webkit.org/show_bug.cgi?id=162735
+
+        Reviewed by Dan Bernstein.
+
+        Add SPI for overriding the following NSURLSessionConfigurations properties:
+            - _sourceApplicationBundleIdentifier
+            - _sourceApplicationSecondaryIdentifier
+            - _CTDataConnectionServiceType
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::initializeNetworkProcess):
+        * NetworkProcess/NetworkProcessCreationParameters.cpp:
+        (WebKit::NetworkProcessCreationParameters::encode):
+        (WebKit::NetworkProcessCreationParameters::decode):
+        * NetworkProcess/NetworkProcessCreationParameters.h:
+        * NetworkProcess/NetworkSession.h:
+        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+        (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::globalSourceApplicationBundleIdentifier):
+        (WebKit::globalSourceApplicationSecondaryIdentifier):
+        (WebKit::globalCTDataConnectionServiceType):
+        (WebKit::NetworkSession::setCustomProtocolManager):
+        (WebKit::NetworkSession::setSourceApplicationAuditTokenData):
+        (WebKit::NetworkSession::setSourceApplicationBundleIdentifier):
+        (WebKit::NetworkSession::setSourceApplicationSecondaryIdentifier):
+        (WebKit::NetworkSession::setCTDataConnectionServiceType):
+        (WebKit::NetworkSession::NetworkSession):
+        * UIProcess/API/APIProcessPoolConfiguration.cpp:
+        (API::ProcessPoolConfiguration::copy):
+        * UIProcess/API/APIProcessPoolConfiguration.h:
+        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
+        * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
+        (-[_WKProcessPoolConfiguration sourceApplicationBundleIdentifier]):
+        (-[_WKProcessPoolConfiguration setSourceApplicationBundleIdentifier:]):
+        (-[_WKProcessPoolConfiguration sourceApplicationSecondaryIdentifier]):
+        (-[_WKProcessPoolConfiguration setSourceApplicationSecondaryIdentifier:]):
+        (-[_WKProcessPoolConfiguration CTDataConnectionServiceType]):
+        (-[_WKProcessPoolConfiguration setCTDataConnectionServiceType:]):
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeNetworkProcess):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
</ins><span class="cx"> 2016-09-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         NetworkSession: HTTP authentication doesn't work if PROTECTION_SPACE_AUTH_CALLBACK is not enabled
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -223,14 +223,6 @@
</span><span class="cx"> 
</span><span class="cx">     setCanHandleHTTPSServerTrustEvaluation(parameters.canHandleHTTPSServerTrustEvaluation);
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA) || USE(CFNETWORK)
-    SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
-#endif
-
-#if USE(NETWORK_SESSION)
-    NetworkSession::setSourceApplicationAuditTokenData(sourceApplicationAuditData());
-#endif
-
</del><span class="cx">     // FIXME: instead of handling this here, a message should be sent later (scales to multiple sessions)
</span><span class="cx">     if (parameters.privateBrowsingEnabled)
</span><span class="cx">         RemoteNetworkingContext::ensurePrivateBrowsingSession(SessionID::legacyPrivateSessionID());
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessCreationParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.cpp (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.cpp        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.cpp        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -70,6 +70,11 @@
</span><span class="cx">     encoder &lt;&lt; uiProcessBundleIdentifier;
</span><span class="cx">     encoder &lt;&lt; nsURLCacheMemoryCapacity;
</span><span class="cx">     encoder &lt;&lt; nsURLCacheDiskCapacity;
</span><ins>+    encoder &lt;&lt; sourceApplicationBundleIdentifier;
+    encoder &lt;&lt; sourceApplicationSecondaryIdentifier;
+#if PLATFORM(IOS)
+    encoder &lt;&lt; ctDataConnectionServiceType;
+#endif
</ins><span class="cx">     encoder &lt;&lt; httpProxy;
</span><span class="cx">     encoder &lt;&lt; httpsProxy;
</span><span class="cx"> #if TARGET_OS_IPHONE || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100)
</span><span class="lines">@@ -142,6 +147,14 @@
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(result.nsURLCacheDiskCapacity))
</span><span class="cx">         return false;
</span><ins>+    if (!decoder.decode(result.sourceApplicationBundleIdentifier))
+        return false;
+    if (!decoder.decode(result.sourceApplicationSecondaryIdentifier))
+        return false;
+#if PLATFORM(IOS)
+    if (!decoder.decode(result.ctDataConnectionServiceType))
+        return false;
+#endif
</ins><span class="cx">     if (!decoder.decode(result.httpProxy))
</span><span class="cx">         return false;
</span><span class="cx">     if (!decoder.decode(result.httpsProxy))
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessCreationParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.h (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.h        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcessCreationParameters.h        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -81,7 +81,11 @@
</span><span class="cx">     String uiProcessBundleIdentifier;
</span><span class="cx">     uint64_t nsURLCacheMemoryCapacity;
</span><span class="cx">     uint64_t nsURLCacheDiskCapacity;
</span><del>-
</del><ins>+    String sourceApplicationBundleIdentifier;
+    String sourceApplicationSecondaryIdentifier;
+#if PLATFORM(IOS)
+    String ctDataConnectionServiceType;
+#endif
</ins><span class="cx">     String httpProxy;
</span><span class="cx">     String httpsProxy;
</span><span class="cx"> #if TARGET_OS_IPHONE || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkSession.h (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkSession.h        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkSession.h        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -62,10 +62,16 @@
</span><span class="cx"> 
</span><span class="cx">     WebCore::SessionID sessionID() const { return m_sessionID; }
</span><span class="cx"> 
</span><ins>+    // Must be called before any NetworkSession has been created.
</ins><span class="cx">     static void setCustomProtocolManager(CustomProtocolManager*);
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     static void setSourceApplicationAuditTokenData(RetainPtr&lt;CFDataRef&gt;&amp;&amp;);
</span><ins>+    static void setSourceApplicationBundleIdentifier(const String&amp;);
+    static void setSourceApplicationSecondaryIdentifier(const String&amp;);
+#if PLATFORM(IOS)
+    static void setCTDataConnectionServiceType(const String&amp;);
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx">     void clearCredentials();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscocoaNetworkProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -29,7 +29,9 @@
</span><span class="cx"> #import &quot;NetworkCache.h&quot;
</span><span class="cx"> #import &quot;NetworkProcessCreationParameters.h&quot;
</span><span class="cx"> #import &quot;NetworkResourceLoader.h&quot;
</span><ins>+#import &quot;NetworkSession.h&quot;
</ins><span class="cx"> #import &quot;SandboxExtension.h&quot;
</span><ins>+#import &quot;SessionTracker.h&quot;
</ins><span class="cx"> #import &lt;WebCore/CFNetworkSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/NetworkStorageSession.h&gt;
</span><span class="cx"> #import &lt;WebCore/PublicSuffix.h&gt;
</span><span class="lines">@@ -80,6 +82,17 @@
</span><span class="cx">     _CFNetworkSetATSContext(parameters.networkATSContext.get());
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
+
+#if USE(NETWORK_SESSION)
+    NetworkSession::setSourceApplicationAuditTokenData(sourceApplicationAuditData());
+    NetworkSession::setSourceApplicationBundleIdentifier(parameters.sourceApplicationBundleIdentifier);
+    NetworkSession::setSourceApplicationSecondaryIdentifier(parameters.sourceApplicationSecondaryIdentifier);
+#if PLATFORM(IOS)
+    NetworkSession::setCTDataConnectionServiceType(parameters.ctDataConnectionServiceType);
+#endif
+#endif
+
</ins><span class="cx">     initializeNetworkSettings();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscocoaNetworkSessionCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -335,16 +335,62 @@
</span><span class="cx">     return sourceApplicationAuditTokenData.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static String&amp; globalSourceApplicationBundleIdentifier()
+{
+    static NeverDestroyed&lt;String&gt; sourceApplicationBundleIdentifier;
+    return sourceApplicationBundleIdentifier.get();
+}
+
+static String&amp; globalSourceApplicationSecondaryIdentifier()
+{
+    static NeverDestroyed&lt;String&gt; sourceApplicationSecondaryIdentifier;
+    return sourceApplicationSecondaryIdentifier.get();
+}
+
+#if PLATFORM(IOS)
+static String&amp; globalCTDataConnectionServiceType()
+{
+    static NeverDestroyed&lt;String&gt; ctDataConnectionServiceType;
+    return ctDataConnectionServiceType.get();
+}
+#endif
+
+#if !ASSERT_DISABLED
+static bool sessionsCreated = false;
+#endif
+
</ins><span class="cx"> void NetworkSession::setCustomProtocolManager(CustomProtocolManager* customProtocolManager)
</span><span class="cx"> {
</span><ins>+    ASSERT(!sessionsCreated);
</ins><span class="cx">     globalCustomProtocolManager() = customProtocolManager;
</span><span class="cx"> }
</span><span class="cx">     
</span><span class="cx"> void NetworkSession::setSourceApplicationAuditTokenData(RetainPtr&lt;CFDataRef&gt;&amp;&amp; data)
</span><span class="cx"> {
</span><ins>+    ASSERT(!sessionsCreated);
</ins><span class="cx">     globalSourceApplicationAuditTokenData() = data;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkSession::setSourceApplicationBundleIdentifier(const String&amp; identifier)
+{
+    ASSERT(!sessionsCreated);
+    globalSourceApplicationBundleIdentifier() = identifier;
+}
+
+void NetworkSession::setSourceApplicationSecondaryIdentifier(const String&amp; identifier)
+{
+    ASSERT(!sessionsCreated);
+    globalSourceApplicationSecondaryIdentifier() = identifier;
+}
+
+#if PLATFORM(IOS)
+void NetworkSession::setCTDataConnectionServiceType(const String&amp; type)
+{
+    ASSERT(!sessionsCreated);
+    globalCTDataConnectionServiceType() = type;
+}
+#endif
+
</ins><span class="cx"> Ref&lt;NetworkSession&gt; NetworkSession::create(Type type, WebCore::SessionID sessionID, CustomProtocolManager* customProtocolManager)
</span><span class="cx"> {
</span><span class="cx">     return adoptRef(*new NetworkSession(type, sessionID, customProtocolManager));
</span><span class="lines">@@ -362,6 +408,10 @@
</span><span class="cx"> {
</span><span class="cx">     relaxAdoptionRequirement();
</span><span class="cx"> 
</span><ins>+#if !ASSERT_DISABLED
+    sessionsCreated = true;
+#endif
+
</ins><span class="cx">     NSURLSessionConfiguration *configuration = configurationForType(type);
</span><span class="cx"> 
</span><span class="cx">     if (NetworkCache::singleton().isEnabled())
</span><span class="lines">@@ -369,7 +419,21 @@
</span><span class="cx">     
</span><span class="cx">     if (auto&amp; data = globalSourceApplicationAuditTokenData())
</span><span class="cx">         configuration._sourceApplicationAuditTokenData = (NSData *)data.get();
</span><del>-    
</del><ins>+
+    auto&amp; sourceApplicationBundleIdentifier = globalSourceApplicationBundleIdentifier();
+    if (!sourceApplicationBundleIdentifier.isEmpty())
+        configuration._sourceApplicationBundleIdentifier = sourceApplicationBundleIdentifier;
+
+    auto&amp; sourceApplicationSecondaryIdentifier = globalSourceApplicationSecondaryIdentifier();
+    if (!sourceApplicationSecondaryIdentifier.isEmpty())
+        configuration._sourceApplicationSecondaryIdentifier = sourceApplicationSecondaryIdentifier;
+
+#if PLATFORM(IOS)
+    auto&amp; ctDataConnectionServiceType = globalCTDataConnectionServiceType();
+    if (!ctDataConnectionServiceType.isEmpty())
+        configuration._CTDataConnectionServiceType = ctDataConnectionServiceType;
+#endif
+
</ins><span class="cx">     if (customProtocolManager)
</span><span class="cx">         customProtocolManager-&gt;registerProtocolClass(configuration);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.cpp        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -111,6 +111,11 @@
</span><span class="cx">     copy-&gt;m_fullySynchronousModeIsAllowedForTesting = this-&gt;m_fullySynchronousModeIsAllowedForTesting;
</span><span class="cx">     copy-&gt;m_ignoreSynchronousMessagingTimeoutsForTesting = this-&gt;m_ignoreSynchronousMessagingTimeoutsForTesting;
</span><span class="cx">     copy-&gt;m_overrideLanguages = this-&gt;m_overrideLanguages;
</span><ins>+    copy-&gt;m_sourceApplicationBundleIdentifier = this-&gt;m_sourceApplicationBundleIdentifier;
+    copy-&gt;m_sourceApplicationSecondaryIdentifier = this-&gt;m_sourceApplicationSecondaryIdentifier;
+#if PLATFORM(IOS)
+    copy-&gt;m_ctDataConnectionServiceType = this-&gt;m_ctDataConnectionServiceType;
+#endif
</ins><span class="cx">     
</span><span class="cx">     return copy;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIProcessPoolConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/UIProcess/API/APIProcessPoolConfiguration.h        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -102,6 +102,17 @@
</span><span class="cx">     const Vector&lt;WTF::String&gt;&amp; overrideLanguages() const { return m_overrideLanguages; }
</span><span class="cx">     void setOverrideLanguages(Vector&lt;WTF::String&gt;&amp;&amp; languages) { m_overrideLanguages = WTFMove(languages); }
</span><span class="cx"> 
</span><ins>+    const WTF::String&amp; sourceApplicationBundleIdentifier() const { return m_sourceApplicationBundleIdentifier; }
+    void setSourceApplicationBundleIdentifier(const WTF::String&amp; sourceApplicationBundleIdentifier) { m_sourceApplicationBundleIdentifier = sourceApplicationBundleIdentifier; }
+
+    const WTF::String&amp; sourceApplicationSecondaryIdentifier() const { return m_sourceApplicationSecondaryIdentifier; }
+    void setSourceApplicationSecondaryIdentifier(const WTF::String&amp; sourceApplicationSecondaryIdentifier) { m_sourceApplicationSecondaryIdentifier = sourceApplicationSecondaryIdentifier; }
+
+#if PLATFORM(IOS)
+    const WTF::String&amp; ctDataConnectionServiceType() const { return m_ctDataConnectionServiceType; }
+    void setCTDataConnectionServiceType(const WTF::String&amp; ctDataConnectionServiceType) { m_ctDataConnectionServiceType = ctDataConnectionServiceType; }
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     bool m_shouldHaveLegacyDataStore { false };
</span><span class="cx"> 
</span><span class="lines">@@ -125,6 +136,11 @@
</span><span class="cx">     bool m_fullySynchronousModeIsAllowedForTesting { false };
</span><span class="cx">     bool m_ignoreSynchronousMessagingTimeoutsForTesting { false };
</span><span class="cx">     Vector&lt;WTF::String&gt; m_overrideLanguages;
</span><ins>+    WTF::String m_sourceApplicationBundleIdentifier;
+    WTF::String m_sourceApplicationSecondaryIdentifier;
+#if PLATFORM(IOS)
+    WTF::String m_ctDataConnectionServiceType;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace API
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKProcessPoolConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -28,17 +28,31 @@
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><ins>+NS_ASSUME_NONNULL_BEGIN
+
</ins><span class="cx"> WK_CLASS_AVAILABLE(macosx(10.10), ios(8.0))
</span><span class="cx"> @interface _WKProcessPoolConfiguration : NSObject &lt;NSCopying&gt;
</span><span class="cx"> 
</span><span class="cx"> @property (nonatomic, copy) NSURL *injectedBundleURL;
</span><span class="cx"> @property (nonatomic) NSUInteger maximumProcessCount;
</span><ins>+
+@property (nonatomic) BOOL ignoreSynchronousMessagingTimeoutsForTesting WK_API_AVAILABLE(macosx(10.12), ios(10.0));
+
+// Network Process properties
+// FIXME: These should be be per-session/data store when we support multiple non-persistent sessions/data stores.
+
</ins><span class="cx"> @property (nonatomic) NSInteger diskCacheSizeOverride WK_API_AVAILABLE(macosx(10.11), ios(9.0));
</span><span class="cx"> @property (nonatomic, copy) NSArray *cachePartitionedURLSchemes;
</span><span class="cx"> @property (nonatomic, copy) NSArray&lt;NSString *&gt; *alwaysRevalidatedURLSchemes WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span><span class="cx"> @property (nonatomic) BOOL diskCacheSpeculativeValidationEnabled WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</span><del>-@property (nonatomic) BOOL ignoreSynchronousMessagingTimeoutsForTesting WK_API_AVAILABLE(macosx(10.12), ios(10.0));
</del><ins>+@property (nonatomic, nullable, copy) NSString *sourceApplicationBundleIdentifier WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+@property (nonatomic, nullable, copy) NSString *sourceApplicationSecondaryIdentifier WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+#if TARGET_OS_IPHONE
+@property (nonatomic, nullable, copy) NSString *CTDataConnectionServiceType WK_API_AVAILABLE(ios(WK_IOS_TBA));
+#endif
</ins><span class="cx"> 
</span><span class="cx"> @end
</span><span class="cx"> 
</span><ins>+NS_ASSUME_NONNULL_END
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKProcessPoolConfigurationmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -151,6 +151,38 @@
</span><span class="cx">     _processPoolConfiguration-&gt;setAlwaysRevalidatedURLSchemes(WTFMove(schemes));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (NSString *)sourceApplicationBundleIdentifier
+{
+    return _processPoolConfiguration-&gt;sourceApplicationBundleIdentifier();
+}
+
+- (void)setSourceApplicationBundleIdentifier:(NSString *)sourceApplicationBundleIdentifier
+{
+    _processPoolConfiguration-&gt;setSourceApplicationBundleIdentifier(sourceApplicationBundleIdentifier);
+}
+
+- (NSString *)sourceApplicationSecondaryIdentifier
+{
+    return _processPoolConfiguration-&gt;sourceApplicationSecondaryIdentifier();
+}
+
+- (void)setSourceApplicationSecondaryIdentifier:(NSString *)sourceApplicationSecondaryIdentifier
+{
+    _processPoolConfiguration-&gt;setSourceApplicationSecondaryIdentifier(sourceApplicationSecondaryIdentifier);
+}
+
+#if PLATFORM(IOS)
+- (NSString *)CTDataConnectionServiceType
+{
+    return _processPoolConfiguration-&gt;ctDataConnectionServiceType();
+}
+
+- (void)setCTDataConnectionServiceType:(NSString *)ctDataConnectionServiceType
+{
+    _processPoolConfiguration-&gt;setCTDataConnectionServiceType(ctDataConnectionServiceType);
+}
+#endif
+
</ins><span class="cx"> - (NSString *)description
</span><span class="cx"> {
</span><span class="cx">     NSString *description = [NSString stringWithFormat:@&quot;&lt;%@: %p; maximumProcessCount = %lu&quot;, NSStringFromClass(self.class), self, static_cast&lt;unsigned long&gt;([self maximumProcessCount])];
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWebProcessPoolCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebProcessPoolCocoa.mm        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -241,6 +241,12 @@
</span><span class="cx">     parameters.shouldEnableNetworkCacheEfficacyLogging = [defaults boolForKey:WebKitNetworkCacheEfficacyLoggingEnabledDefaultsKey];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    parameters.sourceApplicationBundleIdentifier = m_configuration-&gt;sourceApplicationBundleIdentifier();
+    parameters.sourceApplicationSecondaryIdentifier = m_configuration-&gt;sourceApplicationSecondaryIdentifier();
+#if PLATFORM(IOS)
+    parameters.ctDataConnectionServiceType = m_configuration-&gt;ctDataConnectionServiceType();
+#endif
+
</ins><span class="cx">     parameters.shouldSuppressMemoryPressureHandler = [defaults boolForKey:WebKitSuppressMemoryPressureHandlerDefaultsKey];
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -359,10 +359,6 @@
</span><span class="cx">     if (parameters.shouldUseFontSmoothing)
</span><span class="cx">         setShouldUseFontSmoothing(true);
</span><span class="cx"> 
</span><del>-#if PLATFORM(COCOA) || USE(CFNETWORK)
-    SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
-#endif
-
</del><span class="cx">     if (parameters.shouldUseTestingNetworkSession)
</span><span class="cx">         NetworkStorageSession::switchToNewTestingSession();
</span><span class="cx"> 
</span><span class="lines">@@ -391,10 +387,6 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(NETWORK_SESSION)
-    NetworkSession::setSourceApplicationAuditTokenData(sourceApplicationAuditData());
-#endif
-
</del><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API) &amp;&amp; PLATFORM(MAC)
</span><span class="cx">     for (auto hostIter = parameters.pluginLoadClientPolicies.begin(); hostIter != parameters.pluginLoadClientPolicies.end(); ++hostIter) {
</span><span class="cx">         for (auto bundleIdentifierIter = hostIter-&gt;value.begin(); bundleIdentifierIter != hostIter-&gt;value.end(); ++bundleIdentifierIter) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (206603 => 206604)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2016-09-29 19:36:39 UTC (rev 206603)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2016-09-29 19:48:25 UTC (rev 206604)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #import &quot;SandboxExtension.h&quot;
</span><span class="cx"> #import &quot;SandboxInitializationParameters.h&quot;
</span><span class="cx"> #import &quot;SecItemShim.h&quot;
</span><ins>+#import &quot;SessionTracker.h&quot;
</ins><span class="cx"> #import &quot;WKAPICast.h&quot;
</span><span class="cx"> #import &quot;WKBrowsingContextHandleInternal.h&quot;
</span><span class="cx"> #import &quot;WKFullKeyboardAccessWatcher.h&quot;
</span><span class="lines">@@ -51,9 +52,9 @@
</span><span class="cx"> #import &lt;WebCore/MemoryPressureHandler.h&gt;
</span><span class="cx"> #import &lt;WebCore/NSAccessibilitySPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/RuntimeApplicationChecks.h&gt;
</span><del>-#import &lt;WebCore/pthreadSPI.h&gt;
</del><span class="cx"> #import &lt;WebCore/VNodeTracker.h&gt;
</span><span class="cx"> #import &lt;WebCore/WebCoreNSURLExtras.h&gt;
</span><ins>+#import &lt;WebCore/pthreadSPI.h&gt;
</ins><span class="cx"> #import &lt;WebKitSystemInterface.h&gt;
</span><span class="cx"> #import &lt;algorithm&gt;
</span><span class="cx"> #import &lt;dispatch/dispatch.h&gt;
</span><span class="lines">@@ -90,6 +91,7 @@
</span><span class="cx"> void WebProcess::platformInitializeWebProcess(WebProcessCreationParameters&amp;&amp; parameters)
</span><span class="cx"> {
</span><span class="cx">     WebCore::setApplicationBundleIdentifier(parameters.uiProcessBundleIdentifier);
</span><ins>+    SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(SANDBOX_EXTENSIONS)
</span><span class="cx">     SandboxExtension::consumePermanently(parameters.uiProcessBundleResourcePathExtensionHandle);
</span></span></pre>
</div>
</div>

</body>
</html>