Changeset 166103 in webkit


Ignore:
Timestamp:
Mar 21, 2014 3:43:25 PM (10 years ago)
Author:
weinig@apple.com
Message:

[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.

Location:
trunk/Source/WebKit2
Files:
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r166098 r166103  
     12014-03-21  Sam Weinig  <sam@webkit.org>
     2
     3        [WebKit2] Implement NetworkingContext::sourceApplicationAuditData() for WebKit2
     4        https://bugs.webkit.org/show_bug.cgi?id=130528
     5
     6        Reviewed by Tim Horton.
     7
     8        * Platform/IPC/Connection.h:
     9        * Platform/IPC/mac/ConnectionMac.cpp:
     10        (IPC::Connection::getAuditToken):
     11        Expose the audit data if available.
     12
     13        * NetworkProcess/mac/RemoteNetworkingContext.mm:
     14        (WebKit::RemoteNetworkingContext::sourceApplicationAuditData):
     15        * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
     16        (WebKit::WebFrameNetworkingContext::sourceApplicationAuditData):
     17        Pass the audit data corresponding to the UIProcess.
     18
     19        * Configurations/Network-iOS.entitlements: Copied from Configurations/WebContent-iOS.entitlements.
     20        * Configurations/NetworkProcess.xcconfig:
     21        * Configurations/NetworkService.Development.xcconfig:
     22        * Configurations/NetworkService.xcconfig:
     23        * Configurations/WebContent-iOS.entitlements:
     24        Add entitlement allowing the audit data to be used.
     25
    1262014-03-21  Tim Horton  <timothy_horton@apple.com>
    227
  • trunk/Source/WebKit2/Configurations/Network-iOS.entitlements

    r166095 r166103  
    33<plist version="1.0">
    44<dict>
    5         <key>com.apple.private.allow-explicit-graphics-priority</key>
    6         <true/>
    7         <key>com.apple.private.webinspector.allow-remote-inspection</key>
    8         <true/>
    9         <key>dynamic-codesigning</key>
    10         <true/>
    11         <key>com.apple.private.assets.accessible-asset-types</key>
    12         <array>
    13             <string>com.apple.MobileAsset.WebKitBlocklist</string>
    14         </array>
     5        <key>com.apple.private.network.socket-delegate</key>
     6        <true/>
    157</dict>
    168</plist>
  • trunk/Source/WebKit2/Configurations/NetworkProcess.xcconfig

    r162104 r166103  
    3030EXCLUDED_SHIM_FILE_NAME_iphoneos = SecItemShim.dylib;
    3131EXCLUDED_SHIM_FILE_NAME_iphonesimulator = $(EXCLUDED_SHIM_FILE_NAME_iphoneos);
     32
     33CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/Network-iOS.entitlements
     34CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/Network-iOS.entitlements
  • trunk/Source/WebKit2/Configurations/NetworkService.Development.xcconfig

    r164547 r166103  
    3030INFOPLIST_FILE_macosx = NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-OSX.plist;
    3131INFOPLIST_FILE_iphoneos = NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info-iOS.plist;
     32
     33CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/Network-iOS.entitlements
     34CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/Network-iOS.entitlements
  • trunk/Source/WebKit2/Configurations/NetworkService.xcconfig

    r164547 r166103  
    3030INFOPLIST_FILE_macosx = NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist;
    3131INFOPLIST_FILE_iphoneos = NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist;
     32
     33CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*] = Configurations/Network-iOS.entitlements
     34CODE_SIGN_ENTITLEMENTS[sdk=iphonesimulator*] = Configurations/Network-iOS.entitlements
  • trunk/Source/WebKit2/Configurations/WebContent-iOS.entitlements

    r165514 r166103  
    33<plist version="1.0">
    44<dict>
    5         <key>com.apple.private.allow-explicit-graphics-priority</key>
    6         <true/>
    7         <key>com.apple.private.webinspector.allow-remote-inspection</key>
    8         <true/>
    9         <key>dynamic-codesigning</key>
    10         <true/>
    11         <key>com.apple.private.assets.accessible-asset-types</key>
    12         <array>
    13             <string>com.apple.MobileAsset.WebKitBlocklist</string>
    14         </array>
     5        <key>com.apple.private.allow-explicit-graphics-priority</key>
     6        <true/>
     7        <key>com.apple.private.network.socket-delegate</key>
     8        <true/>
     9        <key>com.apple.private.webinspector.allow-remote-inspection</key>
     10        <true/>
     11        <key>dynamic-codesigning</key>
     12        <true/>
     13        <key>com.apple.private.assets.accessible-asset-types</key>
     14        <array>
     15                <string>com.apple.MobileAsset.WebKitBlocklist</string>
     16        </array>
    1517</dict>
    1618</plist>
  • trunk/Source/WebKit2/NetworkProcess/mac/RemoteNetworkingContext.mm

    r166031 r166103  
    2727#import "RemoteNetworkingContext.h"
    2828
     29#import "NetworkProcess.h"
    2930#import "SessionTracker.h"
    3031#import "WebErrors.h"
     
    7071RetainPtr<CFDataRef> RemoteNetworkingContext::sourceApplicationAuditData() const
    7172{
    72     return nil;
     73#if PLATFORM(IOS)
     74    audit_token_t auditToken;
     75    if (!NetworkProcess::shared().parentProcessConnection()->getAuditToken(auditToken))
     76        return nullptr;
     77    return adoptCF(CFDataCreate(0, (const UInt8*)&auditToken, sizeof(auditToken)));
     78#else
     79    return nullptr;
     80#endif
    7381}
    7482
  • trunk/Source/WebKit2/Platform/IPC/Connection.h

    r166031 r166103  
    115115    static bool identifierIsNull(Identifier identifier) { return identifier.port == MACH_PORT_NULL; }
    116116    xpc_connection_t xpcConnection() { return m_xpcConnection; }
    117 
     117    bool getAuditToken(audit_token_t&);
    118118#elif USE(UNIX_DOMAIN_SOCKETS)
    119119    typedef int Identifier;
  • trunk/Source/WebKit2/Platform/IPC/mac/ConnectionMac.cpp

    r166031 r166103  
    3636#include <xpc/xpc.h>
    3737
     38#if __has_include(<xpc/private.h>)
     39#include <xpc/private.h>
     40#endif
     41
     42extern "C" void xpc_connection_get_audit_token(xpc_connection_t, audit_token_t*);
     43
    3844namespace IPC {
    3945
     
    512518}
    513519   
     520bool Connection::getAuditToken(audit_token_t& auditToken)
     521{
     522    if (!m_xpcConnection)
     523        return false;
     524   
     525    xpc_connection_get_audit_token(m_xpcConnection, &auditToken);
     526    return true;
     527}
     528   
    514529} // namespace IPC
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r166096 r166103  
    27442744                7801C095142290C400FAF9AF /* WebHitTestResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebHitTestResult.cpp; sourceTree = "<group>"; };
    27452745                7801C096142290C400FAF9AF /* WebHitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHitTestResult.h; sourceTree = "<group>"; };
     2746                7C0BB9A718DCDE890006C086 /* iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = iOS.xcconfig; sourceTree = "<group>"; };
     2747                7C0BB9A818DCDE890006C086 /* WebContent-iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "WebContent-iOS.entitlements"; sourceTree = "<group>"; };
     2748                7C0BB9A918DCDF5A0006C086 /* Network-iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Network-iOS.entitlements"; sourceTree = "<group>"; };
    27462749                7C135AA6173B0BCA00586AE2 /* WKPluginInformation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPluginInformation.cpp; sourceTree = "<group>"; };
    27472750                7C135AA7173B0BCA00586AE2 /* WKPluginInformation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPluginInformation.h; sourceTree = "<group>"; };
     
    38073810                                1A4F976B100E7B6600637A18 /* DebugRelease.xcconfig */,
    38083811                                1A4F976C100E7B6600637A18 /* FeatureDefines.xcconfig */,
     3812                                7C0BB9A718DCDE890006C086 /* iOS.xcconfig */,
     3813                                7C0BB9A918DCDF5A0006C086 /* Network-iOS.entitlements */,
    38093814                                510CC8461613C7C600D03ED3 /* NetworkProcess.xcconfig */,
    38103815                                BC8283AA16B4BEAD00A278FE /* NetworkService.Development.xcconfig */,
     
    38193824                                5183B3931379F85C00E8754E /* Shim.xcconfig */,
    38203825                                1A4F976E100E7B6600637A18 /* Version.xcconfig */,
     3826                                7C0BB9A818DCDE890006C086 /* WebContent-iOS.entitlements */,
    38213827                                5DAD7294116FF70B00EE5396 /* WebContentProcess.xcconfig */,
    38223828                                BCACC40F16B0B8A800B6E092 /* WebContentService.Development.xcconfig */,
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm

    r166031 r166103  
    2525
    2626#include "config.h"
     27#include "WebFrameNetworkingContext.h"
    2728
    2829#include "SessionTracker.h"
    2930#include "WebCookieManager.h"
    30 #include "WebFrameNetworkingContext.h"
    3131#include "WebPage.h"
     32#include "WebProcess.h"
    3233#include <WebCore/Frame.h>
    3334#include <WebCore/FrameLoader.h>
     
    9192RetainPtr<CFDataRef> WebFrameNetworkingContext::sourceApplicationAuditData() const
    9293{
    93     return RetainPtr<CFDataRef>();
     94#if PLATFORM(IOS)
     95    audit_token_t auditToken;
     96    if (!WebProcess::shared().parentProcessConnection()->getAuditToken(auditToken))
     97        return nullptr;
     98    return adoptCF(CFDataCreate(0, (const UInt8*)&auditToken, sizeof(auditToken)));
     99#else
     100    return nullptr;
     101#endif
    94102}
    95103
Note: See TracChangeset for help on using the changeset viewer.