<!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>[198457] 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/198457">198457</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-03-18 17:05:17 -0700 (Fri, 18 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Give NSURLSessionConfiguration information about parent process
https://bugs.webkit.org/show_bug.cgi?id=155661
Source/WebCore:


Reviewed by Anders Carlsson.

* platform/spi/cf/CFNetworkSPI.h:
Add newly-used SPI declarations.

Source/WebKit2:

rdar://problem/25225850

Reviewed by Anders Carlsson.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::sessionID):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::partitionName):
(WebKit::NetworkProcess::sourceApplicationAuditData):
(WebKit::NetworkProcess::cfURLCacheOrigins):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::globalCustomProtocolManager):
(WebKit::globalSourceApplicationAuditTokenData):
(WebKit::NetworkSession::setCustomProtocolManager):
(WebKit::NetworkSession::setSourceApplicationAuditTokenData):
(WebKit::NetworkSession::defaultSession):
(WebKit::NetworkSession::NetworkSession):
Tell the NSURLSessionConfiguration what the source application bundle identifier
and audit token data are so we can correctly keep track of which application is using data.
This also gives CFNetwork enough information to determine if the application is allowed to
use cell data in Settings, so it seems like we do not need to explicitly set allowsCellularAccess.
* NetworkProcess/mac/RemoteNetworkingContext.mm:
(WebKit::RemoteNetworkingContext::sourceApplicationAuditData):
(WebKit::RemoteNetworkingContext::sourceApplicationIdentifier):
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::sourceApplicationAuditData):
(WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
* WebProcess/WebProcess.h:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformTerminate):
(WebKit::WebProcess::sourceApplicationAuditData):
(WebKit::WebProcess::initializeSandbox):
I moved the calls to getAuditToken from RemoteNetworkingContext.mm and WebFrameNetworkingContext.mm 
to NetworkProcessCocoa.mm and WebProcessCocoa.mm, respectively, to share with NetworkSession code, 
which does not use NetworkingContexts.</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="#trunkSourceWebKit2NetworkProcessNetworkProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.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="#trunkSourceWebKit2NetworkProcessmacRemoteNetworkingContextmm">trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebFrameNetworkingContextmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</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 (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebCore/ChangeLog        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-03-18  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Give NSURLSessionConfiguration information about parent process
+        https://bugs.webkit.org/show_bug.cgi?id=155661
+
+        Reviewed by Anders Carlsson.
+
+        * platform/spi/cf/CFNetworkSPI.h:
+        Add newly-used SPI declarations.
+
</ins><span class="cx"> 2016-03-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Sideways-scrollable RTL document has wrong initial and reload offset in WKWebView
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicfCFNetworkSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebCore/platform/spi/cf/CFNetworkSPI.h        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -97,9 +97,11 @@
</span><span class="cx"> - (NSDictionary *)_timingData;
</span><span class="cx"> @end
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100
</del><ins>+#if (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100) || (PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 90000)
</ins><span class="cx"> @interface NSURLSessionConfiguration ()
</span><span class="cx"> @property (assign) _TimingDataOptions _timingDataOptions;
</span><ins>+@property (copy) NSData *_sourceApplicationAuditTokenData;
+@property (copy) NSString *_sourceApplicationBundleIdentifier;
</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 (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/ChangeLog        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-03-18  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Give NSURLSessionConfiguration information about parent process
+        https://bugs.webkit.org/show_bug.cgi?id=155661
+        rdar://problem/25225850
+
+        Reviewed by Anders Carlsson.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::initializeNetworkProcess):
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkSession.h:
+        (WebKit::NetworkSession::sessionID):
+        * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
+        (WebKit::partitionName):
+        (WebKit::NetworkProcess::sourceApplicationAuditData):
+        (WebKit::NetworkProcess::cfURLCacheOrigins):
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::globalCustomProtocolManager):
+        (WebKit::globalSourceApplicationAuditTokenData):
+        (WebKit::NetworkSession::setCustomProtocolManager):
+        (WebKit::NetworkSession::setSourceApplicationAuditTokenData):
+        (WebKit::NetworkSession::defaultSession):
+        (WebKit::NetworkSession::NetworkSession):
+        Tell the NSURLSessionConfiguration what the source application bundle identifier
+        and audit token data are so we can correctly keep track of which application is using data.
+        This also gives CFNetwork enough information to determine if the application is allowed to
+        use cell data in Settings, so it seems like we do not need to explicitly set allowsCellularAccess.
+        * NetworkProcess/mac/RemoteNetworkingContext.mm:
+        (WebKit::RemoteNetworkingContext::sourceApplicationAuditData):
+        (WebKit::RemoteNetworkingContext::sourceApplicationIdentifier):
+        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
+        (WebKit::WebFrameNetworkingContext::sourceApplicationAuditData):
+        (WebKit::WebFrameNetworkingContext::sourceApplicationIdentifier):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+        * WebProcess/WebProcess.h:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformTerminate):
+        (WebKit::WebProcess::sourceApplicationAuditData):
+        (WebKit::WebProcess::initializeSandbox):
+        I moved the calls to getAuditToken from RemoteNetworkingContext.mm and WebFrameNetworkingContext.mm 
+        to NetworkProcessCocoa.mm and WebProcessCocoa.mm, respectively, to share with NetworkSession code, 
+        which does not use NetworkingContexts.
+
</ins><span class="cx"> 2016-03-18  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Build fix after r198455.
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -218,6 +218,10 @@
</span><span class="cx">     SessionTracker::setIdentifierBase(parameters.uiProcessBundleIdentifier);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(NETWORK_SESSION)
+    NetworkSession::setSourceApplicationAuditTokenData(sourceApplicationAuditData());
+#endif
+
</ins><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="trunkSourceWebKit2NetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &lt;memory&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><ins>+#include &lt;wtf/RetainPtr.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include &quot;WebSQLiteDatabaseTracker.h&quot;
</span><span class="lines">@@ -99,6 +100,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><ins>+    RetainPtr&lt;CFDataRef&gt; sourceApplicationAuditData() const;
</ins><span class="cx">     void clearHSTSCache(WebCore::NetworkStorageSession&amp;, std::chrono::system_clock::time_point modifiedSince);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkSession.h (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkSession.h        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkSession.h        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -65,6 +65,9 @@
</span><span class="cx">     WebCore::NetworkStorageSession&amp; networkStorageSession();
</span><span class="cx"> 
</span><span class="cx">     static void setCustomProtocolManager(CustomProtocolManager*);
</span><ins>+#if PLATFORM(COCOA)
+    static void setSourceApplicationAuditTokenData(RetainPtr&lt;CFDataRef&gt;&amp;&amp;);
+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if !USE(CREDENTIAL_STORAGE_WITH_NETWORK_SESSION)
</span><span class="cx">     void clearCredentials();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscocoaNetworkProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkProcessCocoa.mm        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -179,6 +179,19 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RetainPtr&lt;CFDataRef&gt; NetworkProcess::sourceApplicationAuditData() const
+{
+#if PLATFORM(IOS)
+    audit_token_t auditToken;
+    ASSERT(parentProcessConnection());
+    if (!parentProcessConnection() || !parentProcessConnection()-&gt;getAuditToken(auditToken))
+        return nullptr;
+    return adoptCF(CFDataCreate(nullptr, (const UInt8*)&amp;auditToken, sizeof(auditToken)));
+#else
+    return nullptr;
+#endif
+}
+
</ins><span class="cx"> Vector&lt;Ref&lt;WebCore::SecurityOrigin&gt;&gt; NetworkProcess::cfURLCacheOrigins()
</span><span class="cx"> {
</span><span class="cx">     Vector&lt;Ref&lt;WebCore::SecurityOrigin&gt;&gt; result;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscocoaNetworkSessionCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -276,10 +276,21 @@
</span><span class="cx">     return customProtocolManager.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static RetainPtr&lt;CFDataRef&gt;&amp; globalSourceApplicationAuditTokenData()
+{
+    static NeverDestroyed&lt;RetainPtr&lt;CFDataRef&gt;&gt; sourceApplicationAuditTokenData;
+    return sourceApplicationAuditTokenData.get();
+}
+
</ins><span class="cx"> void NetworkSession::setCustomProtocolManager(CustomProtocolManager* customProtocolManager)
</span><span class="cx"> {
</span><span class="cx">     globalCustomProtocolManager() = customProtocolManager;
</span><span class="cx"> }
</span><ins>+    
+void NetworkSession::setSourceApplicationAuditTokenData(RetainPtr&lt;CFDataRef&gt;&amp;&amp; data)
+{
+    globalSourceApplicationAuditTokenData() = data;
+}
</ins><span class="cx"> 
</span><span class="cx"> Ref&lt;NetworkSession&gt; NetworkSession::create(Type type, WebCore::SessionID sessionID, CustomProtocolManager* customProtocolManager, std::unique_ptr&lt;WebCore::NetworkStorageSession&gt; networkStorageSession)
</span><span class="cx"> {
</span><span class="lines">@@ -301,6 +312,11 @@
</span><span class="cx"> 
</span><span class="cx">     NSURLSessionConfiguration *configuration = configurationForType(type);
</span><span class="cx"> 
</span><ins>+    if (auto&amp; data = globalSourceApplicationAuditTokenData())
+        configuration._sourceApplicationAuditTokenData = (NSData *)data.get();
+    
+    configuration._sourceApplicationBundleIdentifier = SessionTracker::getIdentifierBase();
+    
</ins><span class="cx">     if (customProtocolManager)
</span><span class="cx">         customProtocolManager-&gt;registerProtocolClass(configuration);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacRemoteNetworkingContextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -67,14 +67,7 @@
</span><span class="cx"> 
</span><span class="cx"> RetainPtr&lt;CFDataRef&gt; RemoteNetworkingContext::sourceApplicationAuditData() const
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
-    audit_token_t auditToken;
-    if (!NetworkProcess::singleton().parentProcessConnection()-&gt;getAuditToken(auditToken))
-        return nullptr;
-    return adoptCF(CFDataCreate(0, (const UInt8*)&amp;auditToken, sizeof(auditToken)));
-#else
-    return nullptr;
-#endif
</del><ins>+    return NetworkProcess::singleton().sourceApplicationAuditData();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String RemoteNetworkingContext::sourceApplicationIdentifier() const
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebFrameNetworkingContextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -93,14 +93,7 @@
</span><span class="cx"> 
</span><span class="cx"> RetainPtr&lt;CFDataRef&gt; WebFrameNetworkingContext::sourceApplicationAuditData() const
</span><span class="cx"> {
</span><del>-#if PLATFORM(IOS)
-    audit_token_t auditToken;
-    if (!WebProcess::singleton().parentProcessConnection()-&gt;getAuditToken(auditToken))
-        return nullptr;
-    return adoptCF(CFDataCreate(0, (const UInt8*)&amp;auditToken, sizeof(auditToken)));
-#else
-    return nullptr;
-#endif
</del><ins>+    return WebProcess::singleton().sourceApplicationAuditData();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String WebFrameNetworkingContext::sourceApplicationIdentifier() const
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -376,6 +376,10 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(NETWORK_SESSION)
+    NetworkSession::setSourceApplicationAuditTokenData(sourceApplicationAuditData());
+#endif
+
</ins><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="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -174,6 +174,7 @@
</span><span class="cx">     void statisticsChangedTimerFired();
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><ins>+    RetainPtr&lt;CFDataRef&gt; sourceApplicationAuditData() const;
</ins><span class="cx">     void destroyRenderingResources();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (198456 => 198457)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2016-03-19 00:04:03 UTC (rev 198456)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2016-03-19 00:05:17 UTC (rev 198457)
</span><span class="lines">@@ -304,6 +304,19 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RetainPtr&lt;CFDataRef&gt; WebProcess::sourceApplicationAuditData() const
+{
+#if PLATFORM(IOS)
+    audit_token_t auditToken;
+    ASSERT(parentProcessConnection());
+    if (!parentProcessConnection() || !parentProcessConnection()-&gt;getAuditToken(auditToken))
+        return nullptr;
+    return adoptCF(CFDataCreate(nullptr, (const UInt8*)&amp;auditToken, sizeof(auditToken)));
+#else
+    return nullptr;
+#endif
+}
+
</ins><span class="cx"> void WebProcess::initializeSandbox(const ChildProcessInitializationParameters&amp; parameters, SandboxInitializationParameters&amp; sandboxParameters)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(WEB_PROCESS_SANDBOX)
</span></span></pre>
</div>
</div>

</body>
</html>