Title: [166223] tags/Safari-538.24.2/Source/WebKit2

Diff

Modified: tags/Safari-538.24.2/Source/WebKit2/ChangeLog (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/ChangeLog	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/ChangeLog	2014-03-25 06:24:13 UTC (rev 166223)
@@ -1,5 +1,34 @@
 2014-03-24  Babak Shafiei  <bshaf...@apple.com>
 
+        Merge r166103
+
+    2014-03-21  Sam Weinig  <s...@webkit.org>
+
+            [WebKit2] Implement NetworkingContext::sourceApplicationAuditData() for WebKit2
+            https://bugs.webkit.org/show_bug.cgi?id=130528
+
+            Reviewed by Tim Horton.
+
+            * Platform/IPC/Connection.h:
+            * Platform/IPC/mac/ConnectionMac.cpp:
+            (IPC::Connection::getAuditToken):
+            Expose the audit data if available. 
+
+            * NetworkProcess/mac/RemoteNetworkingContext.mm:
+            (WebKit::RemoteNetworkingContext::sourceApplicationAuditData):
+            * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
+            (WebKit::WebFrameNetworkingContext::sourceApplicationAuditData):
+            Pass the audit data corresponding to the UIProcess.
+
+            * Configurations/Network-iOS.entitlements: Copied from Configurations/WebContent-iOS.entitlements.
+            * Configurations/NetworkProcess.xcconfig:
+            * Configurations/NetworkService.Development.xcconfig:
+            * Configurations/NetworkService.xcconfig:
+            * Configurations/WebContent-iOS.entitlements:
+            Add entitlement allowing the audit data to be used.
+
+2014-03-24  Babak Shafiei  <bshaf...@apple.com>
+
         Merge r165983
 
     2014-03-20  Sam Weinig  <s...@webkit.org>

Copied: tags/Safari-538.24.2/Source/WebKit2/Configurations/Network-iOS.entitlements (from rev 166103, trunk/Source/WebKit2/Configurations/Network-iOS.entitlements) (0 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/Configurations/Network-iOS.entitlements	                        (rev 0)
+++ tags/Safari-538.24.2/Source/WebKit2/Configurations/Network-iOS.entitlements	2014-03-25 06:24:13 UTC (rev 166223)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>com.apple.private.network.socket-delegate</key>
+	<true/>
+</dict>
+</plist>

Modified: tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkProcess.xcconfig (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkProcess.xcconfig	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkProcess.xcconfig	2014-03-25 06:24:13 UTC (rev 166223)
@@ -29,3 +29,6 @@
 EXCLUDED_SHIM_FILE_NAME = $(EXCLUDED_SHIM_FILE_NAME_$(PLATFORM_NAME));
 EXCLUDED_SHIM_FILE_NAME_iphoneos = SecItemShim.dylib;
 EXCLUDED_SHIM_FILE_NAME_iphonesimulator = $(EXCLUDED_SHIM_FILE_NAME_iphoneos);
+
+CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/Network-iOS.entitlements
+CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/Network-iOS.entitlements

Modified: tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkService.Development.xcconfig (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkService.Development.xcconfig	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkService.Development.xcconfig	2014-03-25 06:24:13 UTC (rev 166223)
@@ -29,3 +29,6 @@
 INFOPLIST_FILE = $(INFOPLIST_FILE_$(PLATFORM_NAME));
 INFOPLIST_FILE_macosx = NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-OSX.plist;
 INFOPLIST_FILE_iphoneos = NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-iOS.plist;
+
+CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/Network-iOS.entitlements
+CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/Network-iOS.entitlements

Modified: tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkService.xcconfig (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkService.xcconfig	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/Configurations/NetworkService.xcconfig	2014-03-25 06:24:13 UTC (rev 166223)
@@ -29,3 +29,6 @@
 INFOPLIST_FILE = $(INFOPLIST_FILE_$(PLATFORM_NAME));
 INFOPLIST_FILE_macosx = NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist;
 INFOPLIST_FILE_iphoneos = NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist;
+
+CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/Network-iOS.entitlements
+CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/Network-iOS.entitlements

Modified: tags/Safari-538.24.2/Source/WebKit2/Configurations/WebContent-iOS.entitlements (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/Configurations/WebContent-iOS.entitlements	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/Configurations/WebContent-iOS.entitlements	2014-03-25 06:24:13 UTC (rev 166223)
@@ -2,15 +2,17 @@
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
 <dict>
-        <key>com.apple.private.allow-explicit-graphics-priority</key>
-        <true/>
-        <key>com.apple.private.webinspector.allow-remote-inspection</key>
-        <true/>
-        <key>dynamic-codesigning</key>
-        <true/>
-        <key>com.apple.private.assets.accessible-asset-types</key>
-        <array>
-            <string>com.apple.MobileAsset.WebKitBlocklist</string>
-        </array>
+	<key>com.apple.private.allow-explicit-graphics-priority</key>
+	<true/>
+	<key>com.apple.private.network.socket-delegate</key>
+	<true/>
+	<key>com.apple.private.webinspector.allow-remote-inspection</key>
+	<true/>
+	<key>dynamic-codesigning</key>
+	<true/>
+	<key>com.apple.private.assets.accessible-asset-types</key>
+	<array>
+		<string>com.apple.MobileAsset.WebKitBlocklist</string>
+	</array>
 </dict>
 </plist>

Modified: tags/Safari-538.24.2/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm	2014-03-25 06:24:13 UTC (rev 166223)
@@ -26,6 +26,7 @@
 #import "config.h"
 #import "RemoteNetworkingContext.h"
 
+#import "NetworkProcess.h"
 #import "SessionTracker.h"
 #import "WebErrors.h"
 #import <WebCore/ResourceError.h>
@@ -69,7 +70,14 @@
 
 RetainPtr<CFDataRef> RemoteNetworkingContext::sourceApplicationAuditData() const
 {
-    return nil;
+#if PLATFORM(IOS)
+    audit_token_t auditToken;
+    if (!NetworkProcess::shared().parentProcessConnection()->getAuditToken(auditToken))
+        return nullptr;
+    return adoptCF(CFDataCreate(0, (const UInt8*)&auditToken, sizeof(auditToken)));
+#else
+    return nullptr;
+#endif
 }
 
 ResourceError RemoteNetworkingContext::blockedError(const ResourceRequest& request) const

Modified: tags/Safari-538.24.2/Source/WebKit2/Platform/IPC/Connection.h (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/Platform/IPC/Connection.h	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/Platform/IPC/Connection.h	2014-03-25 06:24:13 UTC (rev 166223)
@@ -114,7 +114,7 @@
     };
     static bool identifierIsNull(Identifier identifier) { return identifier.port == MACH_PORT_NULL; }
     xpc_connection_t xpcConnection() { return m_xpcConnection; }
-
+    bool getAuditToken(audit_token_t&);
 #elif USE(UNIX_DOMAIN_SOCKETS)
     typedef int Identifier;
     static bool identifierIsNull(Identifier identifier) { return !identifier; }

Modified: tags/Safari-538.24.2/Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp	2014-03-25 06:24:13 UTC (rev 166223)
@@ -35,6 +35,12 @@
 #include <wtf/RunLoop.h>
 #include <xpc/xpc.h>
 
+#if __has_include(<xpc/private.h>)
+#include <xpc/private.h>
+#endif
+
+extern "C" void xpc_connection_get_audit_token(xpc_connection_t, audit_token_t*);
+
 namespace IPC {
 
 static const size_t inlineMessageMaxSize = 4096;
@@ -511,4 +517,13 @@
     return Identifier(m_isServer ? m_receivePort : m_sendPort, m_xpcConnection);
 }
     
+bool Connection::getAuditToken(audit_token_t& auditToken)
+{
+    if (!m_xpcConnection)
+        return false;
+    
+    xpc_connection_get_audit_token(m_xpcConnection, &auditToken);
+    return true;
+}
+    
 } // namespace IPC

Modified: tags/Safari-538.24.2/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-03-25 06:24:13 UTC (rev 166223)
@@ -2739,6 +2739,9 @@
 		762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPreferencesPrivate.h; sourceTree = "<group>"; };
 		7801C095142290C400FAF9AF /* WebHitTestResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebHitTestResult.cpp; sourceTree = "<group>"; };
 		7801C096142290C400FAF9AF /* WebHitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHitTestResult.h; sourceTree = "<group>"; };
+		7C0BB9A718DCDE890006C086 /* iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = "<group>"; };
+		7C0BB9A818DCDE890006C086 /* WebContent-iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "WebContent-iOS.entitlements"; sourceTree = "<group>"; };
+		7C0BB9A918DCDF5A0006C086 /* Network-iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Network-iOS.entitlements"; sourceTree = "<group>"; };
 		7C135AA6173B0BCA00586AE2 /* WKPluginInformation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPluginInformation.cpp; sourceTree = "<group>"; };
 		7C135AA7173B0BCA00586AE2 /* WKPluginInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPluginInformation.h; sourceTree = "<group>"; };
 		7C135AAA173B0CFF00586AE2 /* PluginInformationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginInformationMac.mm; sourceTree = "<group>"; };
@@ -3791,6 +3794,8 @@
 				51A60B29180CCD9000F3BF50 /* DatabaseService.xcconfig */,
 				1A4F976B100E7B6600637A18 /* DebugRelease.xcconfig */,
 				1A4F976C100E7B6600637A18 /* FeatureDefines.xcconfig */,
+				7C0BB9A718DCDE890006C086 /* iOS.xcconfig */,
+				7C0BB9A918DCDF5A0006C086 /* Network-iOS.entitlements */,
 				510CC8461613C7C600D03ED3 /* NetworkProcess.xcconfig */,
 				BC8283AA16B4BEAD00A278FE /* NetworkService.Development.xcconfig */,
 				BC8283AB16B4BEAD00A278FE /* NetworkService.xcconfig */,
@@ -3803,6 +3808,7 @@
 				A1EDD2DC1884B9B500BBFE98 /* SecItemShim.xcconfig */,
 				5183B3931379F85C00E8754E /* Shim.xcconfig */,
 				1A4F976E100E7B6600637A18 /* Version.xcconfig */,
+				7C0BB9A818DCDE890006C086 /* WebContent-iOS.entitlements */,
 				5DAD7294116FF70B00EE5396 /* WebContentProcess.xcconfig */,
 				BCACC40F16B0B8A800B6E092 /* WebContentService.Development.xcconfig */,
 				BCACC40E16B0B8A800B6E092 /* WebContentService.xcconfig */,

Modified: tags/Safari-538.24.2/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm (166222 => 166223)


--- tags/Safari-538.24.2/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm	2014-03-25 06:18:51 UTC (rev 166222)
+++ tags/Safari-538.24.2/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm	2014-03-25 06:24:13 UTC (rev 166223)
@@ -24,11 +24,12 @@
  */
 
 #include "config.h"
+#include "WebFrameNetworkingContext.h"
 
 #include "SessionTracker.h"
 #include "WebCookieManager.h"
-#include "WebFrameNetworkingContext.h"
 #include "WebPage.h"
+#include "WebProcess.h"
 #include <WebCore/Frame.h>
 #include <WebCore/FrameLoader.h>
 #include <WebCore/FrameLoaderClient.h>
@@ -90,7 +91,14 @@
 
 RetainPtr<CFDataRef> WebFrameNetworkingContext::sourceApplicationAuditData() const
 {
-    return RetainPtr<CFDataRef>();
+#if PLATFORM(IOS)
+    audit_token_t auditToken;
+    if (!WebProcess::shared().parentProcessConnection()->getAuditToken(auditToken))
+        return nullptr;
+    return adoptCF(CFDataCreate(0, (const UInt8*)&auditToken, sizeof(auditToken)));
+#else
+    return nullptr;
+#endif
 }
 
 ResourceError WebFrameNetworkingContext::blockedError(const ResourceRequest& request) const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to