Changeset 86686 in webkit


Ignore:
Timestamp:
May 17, 2011, 10:39:59 AM (15 years ago)
Author:
beidson@apple.com
Message:

Part 2 of <rdar://problem/8814289> and https://bugs.webkit.org/show_bug.cgi?id=60595
Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess

Reviewed by Anders Carlsson.

Hookup some of the methods we plan to shim in the patch, but just have them call through
to the actual implementations for now.

Also stub-out the future shimmed versions of the methods.

  • WebProcess/mac/WebProcessShim.h: Add the methods to the shim callbacks.
  • WebProcess/mac/WebProcessShim.mm:

(WebKit::shimSecItemCopyMatching): Call through to the actual function for now.
(WebKit::shimSecItemAdd): Ditto.
(WebKit::shimSecItemUpdate): Ditto.
(WebKit::shimSecItemDelete): Ditto.
(WebKit::WebKitWebProcessShimInitialize): Copy over the shim callbacks.

  • WebKit2.xcodeproj/project.pbxproj: Link the shim to required frameworks.


  • WebProcess/mac/WebProcessMac.mm:

(WebKit::WebSecItemCopyMatching): Add placeholders for the future to-be-shimmed functions.
(WebKit::WebSecItemAdd): Ditto.
(WebKit::WebSecItemUpdate): Ditto.
(WebKit::WebSecItemDelete): Ditto.
(WebKit::WebProcess::initializeShim): Pass along those placeholders to the shim initializer.

Location:
trunk/Source/WebKit2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r86678 r86686  
    33        Reviewed by Anders Carlsson.
    44
    5         Part one of <rdar://problem/8814289> and https://bugs.webkit.org/show_bug.cgi?id=60595
     5        Part 2 of <rdar://problem/8814289> and https://bugs.webkit.org/show_bug.cgi?id=60595
     6        Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess
     7
     8        Hookup some of the methods we plan to shim in the patch, but just have them call through
     9        to the actual implementations for now.
     10
     11        Also stub-out the future shimmed versions of the methods.
     12
     13        * WebProcess/mac/WebProcessShim.h: Add the methods to the shim callbacks.
     14        * WebProcess/mac/WebProcessShim.mm:
     15        (WebKit::shimSecItemCopyMatching): Call through to the actual function for now.
     16        (WebKit::shimSecItemAdd): Ditto.
     17        (WebKit::shimSecItemUpdate): Ditto.
     18        (WebKit::shimSecItemDelete): Ditto.
     19        (WebKit::WebKitWebProcessShimInitialize): Copy over the shim callbacks.
     20        * WebKit2.xcodeproj/project.pbxproj: Link the shim to required frameworks.
     21       
     22        * WebProcess/mac/WebProcessMac.mm:
     23        (WebKit::WebSecItemCopyMatching): Add placeholders for the future to-be-shimmed functions.
     24        (WebKit::WebSecItemAdd): Ditto.
     25        (WebKit::WebSecItemUpdate): Ditto.
     26        (WebKit::WebSecItemDelete): Ditto.
     27        (WebKit::WebProcess::initializeShim): Pass along those placeholders to the shim initializer.
     28
     292011-05-17  Brady Eidson  <beidson@apple.com>
     30
     31        Reviewed by Anders Carlsson.
     32
     33        Part 1 of <rdar://problem/8814289> and https://bugs.webkit.org/show_bug.cgi?id=60595
    634        Mac WebKit2 WebProcess needs a shim to make prompts appear to be from the UIProcess
    735
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r86678 r86686  
    370370                51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */; };
    371371                51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */; };
     372                51D1304E1382E5B700351EDD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF5068412431861005955AE /* Security.framework */; };
    372373                6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */; };
    373374                659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */; };
     
    18081809                        buildActionMask = 2147483647;
    18091810                        files = (
     1811                                51D1304E1382E5B700351EDD /* Security.framework in Frameworks */,
    18101812                        );
    18111813                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm

    r86678 r86686  
    240240}
    241241
     242static OSStatus WebSecItemCopyMatching(CFDictionaryRef query, CFTypeRef *result)
     243{
     244    ASSERT_NOT_REACHED();
     245    return -1;
     246}
     247
     248static OSStatus WebSecItemAdd(CFDictionaryRef query, CFTypeRef *result)
     249{
     250    ASSERT_NOT_REACHED();
     251    return -1;
     252}
     253
     254static OSStatus WebSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
     255{
     256    ASSERT_NOT_REACHED();
     257    return -1;
     258}
     259
     260static OSStatus WebSecItemDelete(CFDictionaryRef query)
     261{
     262    ASSERT_NOT_REACHED();
     263    return -1;
     264}
     265
    242266void WebProcess::initializeShim()
    243267{
    244268    const WebProcessShimCallbacks callbacks = {
     269        WebSecItemCopyMatching,
     270        WebSecItemAdd,
     271        WebSecItemUpdate,
     272        WebSecItemDelete
    245273    };
    246274   
  • trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.h

    r86678 r86686  
    3030
    3131struct WebProcessShimCallbacks {
     32    OSStatus (*secItemCopyMatching)(CFDictionaryRef query, CFTypeRef *result);
     33    OSStatus (*secItemAdd)(CFDictionaryRef attributes, CFTypeRef *result);
     34    OSStatus (*secItemUpdate)(CFDictionaryRef query, CFDictionaryRef attributesToUpdate);
     35    OSStatus (*secItemDelete)(CFDictionaryRef query);
    3236};
    3337
  • trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.mm

    r86678 r86686  
    2626#import "WebProcessShim.h"
    2727
     28#import <Security/SecItem.h>
     29
    2830#define DYLD_INTERPOSE(_replacement,_replacee) \
    2931    __attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \
     
    3436extern "C" void WebKitWebProcessShimInitialize(const WebProcessShimCallbacks&);
    3537
     38static WebProcessShimCallbacks webProcessShimCallbacks;
     39
     40static OSStatus shimSecItemCopyMatching(CFDictionaryRef query, CFTypeRef *result)
     41{
     42    return SecItemCopyMatching(query, result);
     43}
     44
     45static OSStatus shimSecItemAdd(CFDictionaryRef query, CFTypeRef *result)
     46{
     47    return SecItemAdd(query, result);
     48}
     49
     50static OSStatus shimSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
     51{
     52    return SecItemUpdate(query, attributesToUpdate);
     53}
     54
     55static OSStatus shimSecItemDelete(CFDictionaryRef query)
     56{
     57    return SecItemDelete(query);
     58}
     59
     60DYLD_INTERPOSE(shimSecItemCopyMatching, SecItemCopyMatching)
     61DYLD_INTERPOSE(shimSecItemAdd, SecItemAdd)
     62DYLD_INTERPOSE(shimSecItemUpdate, SecItemUpdate)
     63DYLD_INTERPOSE(shimSecItemDelete, SecItemDelete)
     64
    3665__attribute__((visibility("default")))
    3766void WebKitWebProcessShimInitialize(const WebProcessShimCallbacks& callbacks)
    3867{
     68    webProcessShimCallbacks = callbacks;
    3969}
    4070
Note: See TracChangeset for help on using the changeset viewer.