Title: [86686] trunk/Source/WebKit2
Revision
86686
Author
[email protected]
Date
2011-05-17 10:39:59 -0700 (Tue, 17 May 2011)

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

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (86685 => 86686)


--- trunk/Source/WebKit2/ChangeLog	2011-05-17 17:38:17 UTC (rev 86685)
+++ trunk/Source/WebKit2/ChangeLog	2011-05-17 17:39:59 UTC (rev 86686)
@@ -2,9 +2,37 @@
 
         Reviewed by Anders Carlsson.
 
-        Part one of <rdar://problem/8814289> and https://bugs.webkit.org/show_bug.cgi?id=60595
+        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
 
+        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.
+
+2011-05-17  Brady Eidson  <[email protected]>
+
+        Reviewed by Anders Carlsson.
+
+        Part 1 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
+
         Add am empty shim for a new WebProcess shim and install it at launch.
 
         Use the same Shim.xcconfig for both the web and plugin processes:

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (86685 => 86686)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2011-05-17 17:38:17 UTC (rev 86685)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2011-05-17 17:39:59 UTC (rev 86686)
@@ -369,6 +369,7 @@
 		51D02F6A132EC73700BEAA96 /* WebIconDatabaseMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F67132EC73700BEAA96 /* WebIconDatabaseMessages.h */; };
 		51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51D02F68132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp */; };
 		51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 51D02F69132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h */; };
+		51D1304E1382E5B700351EDD /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCF5068412431861005955AE /* Security.framework */; };
 		6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65B86F1712F11D7B00B7DD8A /* WKBundleInspector.cpp */; };
 		659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6546A82913000164000CEB1C /* InjectedBundlePageResourceLoadClient.cpp */; };
 		65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */ = {isa = PBXBuildFile; fileRef = 65B86F1812F11D7B00B7DD8A /* WKBundleInspector.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1807,6 +1808,7 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				51D1304E1382E5B700351EDD /* Security.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm (86685 => 86686)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm	2011-05-17 17:38:17 UTC (rev 86685)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm	2011-05-17 17:39:59 UTC (rev 86686)
@@ -239,9 +239,37 @@
     method_setImplementation(methodToPatch, (IMP)NSApplicationAccessibilityFocusedUIElement);
 }
 
+static OSStatus WebSecItemCopyMatching(CFDictionaryRef query, CFTypeRef *result)
+{
+    ASSERT_NOT_REACHED();
+    return -1;
+}
+
+static OSStatus WebSecItemAdd(CFDictionaryRef query, CFTypeRef *result)
+{
+    ASSERT_NOT_REACHED();
+    return -1;
+}
+
+static OSStatus WebSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
+{
+    ASSERT_NOT_REACHED();
+    return -1;
+}
+
+static OSStatus WebSecItemDelete(CFDictionaryRef query)
+{
+    ASSERT_NOT_REACHED();
+    return -1;
+}
+
 void WebProcess::initializeShim()
 {
     const WebProcessShimCallbacks callbacks = {
+        WebSecItemCopyMatching,
+        WebSecItemAdd,
+        WebSecItemUpdate,
+        WebSecItemDelete
     };
     
     WebProcessShimInitializeFunc initFunc = reinterpret_cast<WebProcessShimInitializeFunc>(dlsym(RTLD_DEFAULT, "WebKitWebProcessShimInitialize"));

Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.h (86685 => 86686)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.h	2011-05-17 17:38:17 UTC (rev 86685)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.h	2011-05-17 17:39:59 UTC (rev 86686)
@@ -29,6 +29,10 @@
 namespace WebKit {
 
 struct WebProcessShimCallbacks {
+    OSStatus (*secItemCopyMatching)(CFDictionaryRef query, CFTypeRef *result);
+    OSStatus (*secItemAdd)(CFDictionaryRef attributes, CFTypeRef *result);
+    OSStatus (*secItemUpdate)(CFDictionaryRef query, CFDictionaryRef attributesToUpdate);
+    OSStatus (*secItemDelete)(CFDictionaryRef query);
 };
 
 typedef void (*WebProcessShimInitializeFunc)(const WebProcessShimCallbacks& callbacks);

Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.mm (86685 => 86686)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.mm	2011-05-17 17:38:17 UTC (rev 86685)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.mm	2011-05-17 17:39:59 UTC (rev 86686)
@@ -25,6 +25,8 @@
 
 #import "WebProcessShim.h"
 
+#import <Security/SecItem.h>
+
 #define DYLD_INTERPOSE(_replacement,_replacee) \
     __attribute__((used)) static struct{ const void* replacement; const void* replacee; } _interpose_##_replacee \
     __attribute__ ((section ("__DATA,__interpose"))) = { (const void*)(unsigned long)&_replacement, (const void*)(unsigned long)&_replacee };
@@ -33,9 +35,37 @@
 
 extern "C" void WebKitWebProcessShimInitialize(const WebProcessShimCallbacks&);
 
+static WebProcessShimCallbacks webProcessShimCallbacks;
+
+static OSStatus shimSecItemCopyMatching(CFDictionaryRef query, CFTypeRef *result)
+{
+    return SecItemCopyMatching(query, result);
+}
+
+static OSStatus shimSecItemAdd(CFDictionaryRef query, CFTypeRef *result)
+{
+    return SecItemAdd(query, result);
+}
+
+static OSStatus shimSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
+{
+    return SecItemUpdate(query, attributesToUpdate);
+}
+
+static OSStatus shimSecItemDelete(CFDictionaryRef query)
+{
+    return SecItemDelete(query);
+}
+
+DYLD_INTERPOSE(shimSecItemCopyMatching, SecItemCopyMatching)
+DYLD_INTERPOSE(shimSecItemAdd, SecItemAdd)
+DYLD_INTERPOSE(shimSecItemUpdate, SecItemUpdate)
+DYLD_INTERPOSE(shimSecItemDelete, SecItemDelete)
+
 __attribute__((visibility("default")))
 void WebKitWebProcessShimInitialize(const WebProcessShimCallbacks& callbacks)
 {
+    webProcessShimCallbacks = callbacks;
 }
 
 } // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to