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

Log Message

Part one 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.

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:
* Configurations/PluginProcessShim.xcconfig: Removed.
* Configurations/Shim.xcconfig: Copied from Configurations/PluginProcessShim.xcconfig.
* WebKit2.xcodeproj/project.pbxproj:

* WebProcess/WebProcess.h: Add initializeShim() for Mac-only
* WebProcess/mac/WebProcessMac.mm:
(WebKit::WebProcess::initializeShim): Initialize the (empty) shim callbacks.

* WebProcess/mac/WebProcessMainMac.mm:
(WebKit::WebProcessMain): Call initializeShim()

* WebProcess/mac/WebProcessShim.h: Added.
* WebProcess/mac/WebProcessShim.mm: Added.
(WebKit::WebKitWebProcessShimInitialize): Empty for now.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess): Install the Plugin Process shim for plugin processes
  and the WebProcess shim for the web content process.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (86677 => 86678)


--- trunk/Source/WebKit2/ChangeLog	2011-05-17 17:05:55 UTC (rev 86677)
+++ trunk/Source/WebKit2/ChangeLog	2011-05-17 17:12:37 UTC (rev 86678)
@@ -1,3 +1,32 @@
+2011-05-17  Brady Eidson  <[email protected]>
+
+        Reviewed by Anders Carlsson.
+
+        Part one 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:
+        * Configurations/PluginProcessShim.xcconfig: Removed.
+        * Configurations/Shim.xcconfig: Copied from Configurations/PluginProcessShim.xcconfig.
+        * WebKit2.xcodeproj/project.pbxproj:
+
+        * WebProcess/WebProcess.h: Add initializeShim() for Mac-only
+        * WebProcess/mac/WebProcessMac.mm:
+        (WebKit::WebProcess::initializeShim): Initialize the (empty) shim callbacks.
+
+        * WebProcess/mac/WebProcessMainMac.mm:
+        (WebKit::WebProcessMain): Call initializeShim()
+
+        * WebProcess/mac/WebProcessShim.h: Added.
+        * WebProcess/mac/WebProcessShim.mm: Added.
+        (WebKit::WebKitWebProcessShimInitialize): Empty for now.
+
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::ProcessLauncher::launchProcess): Install the Plugin Process shim for plugin processes
+          and the WebProcess shim for the web content process.
+
 2011-05-17  John Sullivan  <[email protected]>
 
         Reviewed by Adam Roben.

Deleted: trunk/Source/WebKit2/Configurations/PluginProcessShim.xcconfig (86677 => 86678)


--- trunk/Source/WebKit2/Configurations/PluginProcessShim.xcconfig	2011-05-17 17:05:55 UTC (rev 86677)
+++ trunk/Source/WebKit2/Configurations/PluginProcessShim.xcconfig	2011-05-17 17:12:37 UTC (rev 86678)
@@ -1,30 +0,0 @@
-// Copyright (C) 2010 Apple Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-// 1. Redistributions of source code must retain the above copyright
-//    notice, this list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright
-//    notice, this list of conditions and the following disclaimer in the
-//    documentation and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
-// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
-// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
-
-#include "BaseTarget.xcconfig"
-
-GCC_DYNAMIC_NO_PIC = NO;
-HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include;
-PRODUCT_NAME = PluginProcessShim;
-SKIP_INSTALL = YES;
-

Copied: trunk/Source/WebKit2/Configurations/Shim.xcconfig (from rev 86180, trunk/Source/WebKit2/Configurations/PluginProcessShim.xcconfig) (0 => 86678)


--- trunk/Source/WebKit2/Configurations/Shim.xcconfig	                        (rev 0)
+++ trunk/Source/WebKit2/Configurations/Shim.xcconfig	2011-05-17 17:12:37 UTC (rev 86678)
@@ -0,0 +1,29 @@
+// Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+//    notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+//    notice, this list of conditions and the following disclaimer in the
+//    documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+#include "BaseTarget.xcconfig"
+
+GCC_DYNAMIC_NO_PIC = NO;
+HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include;
+SKIP_INSTALL = YES;
+

Modified: trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm (86677 => 86678)


--- trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2011-05-17 17:05:55 UTC (rev 86677)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm	2011-05-17 17:12:37 UTC (rev 86678)
@@ -142,15 +142,18 @@
     if (![frameworksPath hasPrefix:@"/System/"])
         environmentVariables.appendValue("DYLD_FRAMEWORK_PATH", [frameworksPath fileSystemRepresentation], ':');
 
-    if (m_launchOptions.processType == ProcessLauncher::PluginProcess) {
-        // We need to insert the plug-in process shim.
-        NSString *pluginProcessShimPathNSString = [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"PluginProcessShim.dylib"];
-        const char* pluginProcessShimPath = [pluginProcessShimPathNSString fileSystemRepresentation];
-
-        // Make sure that the file exists.
+    NSString *processShimPathNSString = nil;
+    if (m_launchOptions.processType == ProcessLauncher::PluginProcess)
+        processShimPathNSString = [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"PluginProcessShim.dylib"];
+    else if (m_launchOptions.processType == ProcessLauncher::WebProcess)
+        processShimPathNSString = [[processAppExecutablePath stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"WebProcessShim.dylib"];
+    
+    // Make sure that the shim library file exists and insert it.
+    if (processShimPathNSString) {
+        const char* processShimPath = [processShimPathNSString fileSystemRepresentation];
         struct stat statBuf;
-        if (stat(pluginProcessShimPath, &statBuf) == 0 && (statBuf.st_mode & S_IFMT) == S_IFREG)
-            environmentVariables.appendValue("DYLD_INSERT_LIBRARIES", pluginProcessShimPath, ':');
+        if (stat(processShimPath, &statBuf) == 0 && (statBuf.st_mode & S_IFMT) == S_IFREG)
+            environmentVariables.appendValue("DYLD_INSERT_LIBRARIES", processShimPath, ':');
     }
     
     int result = posix_spawn(&processIdentifier, args[0], 0, &attr, const_cast<char**>(args), environmentVariables.environmentPointer());

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (86677 => 86678)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2011-05-17 17:05:55 UTC (rev 86677)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2011-05-17 17:12:37 UTC (rev 86678)
@@ -279,6 +279,8 @@
 		37C4E9F6131C6E7E0029BD5A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = B396EA5512E0ED2D00F4FEB7 /* config.h */; };
 		37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		37F90DE31376560E0051CF68 /* HTTPCookieAcceptPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */; };
+		510031D51379C11300C8DFE4 /* WebProcessShim.h in Headers */ = {isa = PBXBuildFile; fileRef = 510031D31379C11300C8DFE4 /* WebProcessShim.h */; };
+		510031F71379CB1600C8DFE4 /* WebProcessShim.mm in Sources */ = {isa = PBXBuildFile; fileRef = 510031D41379C11300C8DFE4 /* WebProcessShim.mm */; };
 		51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */; };
 		510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */; };
 		510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */; };
@@ -331,6 +333,8 @@
 		516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */ = {isa = PBXBuildFile; fileRef = 516A4A5B120A2CCD00C05B7F /* WebError.h */; };
 		51834592134532E90092B696 /* WebIconDatabaseClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51834590134532E80092B696 /* WebIconDatabaseClient.cpp */; };
 		51834593134532E90092B696 /* WebIconDatabaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51834591134532E80092B696 /* WebIconDatabaseClient.h */; };
+		5183B3921379F7B800E8754E /* WebProcessShim.dylib in Copy Web Process Shim */ = {isa = PBXBuildFile; fileRef = 510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */; };
+		5183B3941379F85C00E8754E /* Shim.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 5183B3931379F85C00E8754E /* Shim.xcconfig */; };
 		51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51871B59127CB89D00F76232 /* WebContextMenu.cpp */; };
 		51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 51871B5A127CB89D00F76232 /* WebContextMenu.h */; };
 		518ACAEA12AEE6BB00B04B83 /* WKProtectionSpaceTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -853,6 +857,13 @@
 			remoteGlobalIDString = C0CE72851247E66800BC0EC4;
 			remoteInfo = "Derived Sources";
 		};
+		5183B38D1379F54600E8754E /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 510031EA1379CACB00C8DFE4;
+			remoteInfo = WebProcessShim;
+		};
 		BCDE093513272496001259FB /* PBXContainerItemProxy */ = {
 			isa = PBXContainerItemProxy;
 			containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -888,6 +899,17 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		5183B38F1379F56800E8754E /* Copy Web Process Shim */ = {
+			isa = PBXCopyFilesBuildPhase;
+			buildActionMask = 2147483647;
+			dstPath = WebProcess.app/Contents/MacOS;
+			dstSubfolderSpec = 16;
+			files = (
+				5183B3921379F7B800E8754E /* WebProcessShim.dylib in Copy Web Process Shim */,
+			);
+			name = "Copy Web Process Shim";
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		BCDE093C13272496001259FB /* Copy Plug-in Process Shim */ = {
 			isa = PBXCopyFilesBuildPhase;
 			buildActionMask = 2147483647;
@@ -1091,7 +1113,6 @@
 		1AC25F8912A48E0300BD2671 /* PluginProcessShim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessShim.h; sourceTree = "<group>"; };
 		1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProcessShim.mm; sourceTree = "<group>"; };
 		1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = PluginProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
-		1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = PluginProcessShim.xcconfig; sourceTree = "<group>"; };
 		1AC41AC51263C88300054E94 /* BinarySemaphore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BinarySemaphore.h; sourceTree = "<group>"; };
 		1AC41AC61263C88300054E94 /* BinarySemaphore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BinarySemaphore.cpp; sourceTree = "<group>"; };
 		1AC86FF1130B46D3002C1257 /* WKPluginSiteDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKPluginSiteDataManager.cpp; sourceTree = "<group>"; };
@@ -1174,6 +1195,9 @@
 		33D3A3C71339617900709BE4 /* WebMediaCacheManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaCacheManagerProxyMessages.h; sourceTree = "<group>"; };
 		33F9D5B81312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = WebResourceCacheManagerCFNet.cpp; path = ResourceCache/cf/WebResourceCacheManagerCFNet.cpp; sourceTree = "<group>"; };
 		37F623B712A57B6200E3FDF6 /* WKFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFindOptions.h; sourceTree = "<group>"; };
+		510031D31379C11300C8DFE4 /* WebProcessShim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessShim.h; sourceTree = "<group>"; };
+		510031D41379C11300C8DFE4 /* WebProcessShim.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessShim.mm; sourceTree = "<group>"; };
+		510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
 		51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClientMac.mm; sourceTree = "<group>"; };
 		510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenuItemData.cpp; sourceTree = "<group>"; };
 		510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuItemData.h; sourceTree = "<group>"; };
@@ -1229,6 +1253,7 @@
 		517A33B4130B308C00F80CB5 /* WKApplicationCacheManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKApplicationCacheManager.h; sourceTree = "<group>"; };
 		51834590134532E80092B696 /* WebIconDatabaseClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIconDatabaseClient.cpp; sourceTree = "<group>"; };
 		51834591134532E80092B696 /* WebIconDatabaseClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseClient.h; sourceTree = "<group>"; };
+		5183B3931379F85C00E8754E /* Shim.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Shim.xcconfig; sourceTree = "<group>"; };
 		5184BC4A132E907A006B9E28 /* WebIconDatabase.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebIconDatabase.messages.in; sourceTree = "<group>"; };
 		51871B59127CB89D00F76232 /* WebContextMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenu.cpp; sourceTree = "<group>"; };
 		51871B5A127CB89D00F76232 /* WebContextMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenu.h; sourceTree = "<group>"; };
@@ -1778,6 +1803,13 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		510031EE1379CACB00C8DFE4 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		8DC2EF560486A6940098B216 /* Frameworks */ = {
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
@@ -1805,6 +1837,7 @@
 				1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */,
 				1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */,
 				BCDE094213272496001259FB /* PluginProcess.app */,
+				510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -1937,12 +1970,12 @@
 		1A4F9769100E7B6600637A18 /* Configurations */ = {
 			isa = PBXGroup;
 			children = (
+				5183B3931379F85C00E8754E /* Shim.xcconfig */,
 				1A4F976A100E7B6600637A18 /* Base.xcconfig */,
 				5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */,
 				1A4F976B100E7B6600637A18 /* DebugRelease.xcconfig */,
 				1A4F976C100E7B6600637A18 /* FeatureDefines.xcconfig */,
 				BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */,
-				1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */,
 				1A4F976E100E7B6600637A18 /* Version.xcconfig */,
 				BCB86F4B116AAACD00CE20B7 /* WebKit2.xcconfig */,
 				5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */,
@@ -1977,6 +2010,8 @@
 			children = (
 				1A6FA01D11E1526300DB1371 /* WebProcessMainMac.mm */,
 				BC3065C312592F8900E71278 /* WebProcessMac.mm */,
+				510031D31379C11300C8DFE4 /* WebProcessShim.h */,
+				510031D41379C11300C8DFE4 /* WebProcessShim.mm */,
 				E1BB1688132018BA00F49431 /* FullKeyboardAccessWatcher.h */,
 				E1BB1689132018BA00F49431 /* FullKeyboardAccessWatcher.mm */,
 			);
@@ -3338,6 +3373,13 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		510031EB1379CACB00C8DFE4 /* Headers */ = {
+			isa = PBXHeadersBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		8DC2EF500486A6940098B216 /* Headers */ = {
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
@@ -3732,6 +3774,7 @@
 				6EE849C81368D9390038D481 /* WKInspectorMac.h in Headers */,
 				37F90DE31376560E0051CF68 /* HTTPCookieAcceptPolicy.h in Headers */,
 				1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */,
+				510031D51379C11300C8DFE4 /* WebProcessShim.h in Headers */,
 				1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -3745,10 +3788,12 @@
 			buildPhases = (
 				1A50DB1A110A3BDC000D3FE5 /* Resources */,
 				1A50DB1B110A3BDC000D3FE5 /* Sources */,
+				5183B38F1379F56800E8754E /* Copy Web Process Shim */,
 			);
 			buildRules = (
 			);
 			dependencies = (
+				5183B38E1379F54600E8754E /* PBXTargetDependency */,
 				1A50DB27110A3BEF000D3FE5 /* PBXTargetDependency */,
 			);
 			name = WebProcess;
@@ -3773,6 +3818,23 @@
 			productReference = 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */;
 			productType = "com.apple.product-type.library.dynamic";
 		};
+		510031EA1379CACB00C8DFE4 /* WebProcessShim */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 510031F21379CACB00C8DFE4 /* Build configuration list for PBXNativeTarget "WebProcessShim" */;
+			buildPhases = (
+				510031EB1379CACB00C8DFE4 /* Headers */,
+				510031EC1379CACB00C8DFE4 /* Sources */,
+				510031EE1379CACB00C8DFE4 /* Frameworks */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = WebProcessShim;
+			productName = PluginProcessShim;
+			productReference = 510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */;
+			productType = "com.apple.product-type.library.dynamic";
+		};
 		8DC2EF4F0486A6940098B216 /* WebKit2 */ = {
 			isa = PBXNativeTarget;
 			buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "WebKit2" */;
@@ -3843,6 +3905,7 @@
 				BCDE093313272496001259FB /* PluginProcess */,
 				C0CE72851247E66800BC0EC4 /* Derived Sources */,
 				1AC25FAF12A48EA700BD2671 /* PluginProcessShim */,
+				510031EA1379CACB00C8DFE4 /* WebProcessShim */,
 			);
 		};
 /* End PBXProject section */
@@ -3861,6 +3924,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
+				5183B3941379F85C00E8754E /* Shim.xcconfig in Resources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3980,6 +4044,14 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		510031EC1379CACB00C8DFE4 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				510031F71379CB1600C8DFE4 /* WebProcessShim.mm in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 		8DC2EF540486A6940098B216 /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
@@ -4396,6 +4468,11 @@
 			target = C0CE72851247E66800BC0EC4 /* Derived Sources */;
 			targetProxy = 37F7407812721F740093869B /* PBXContainerItemProxy */;
 		};
+		5183B38E1379F54600E8754E /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 510031EA1379CACB00C8DFE4 /* WebProcessShim */;
+			targetProxy = 5183B38D1379F54600E8754E /* PBXContainerItemProxy */;
+		};
 		BCDE093413272496001259FB /* PBXTargetDependency */ = {
 			isa = PBXTargetDependency;
 			target = 1AC25FAF12A48EA700BD2671 /* PluginProcessShim */;
@@ -4455,34 +4532,37 @@
 		};
 		1AC25FB112A48EA700BD2671 /* Debug */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */;
+			baseConfigurationReference = 5183B3931379F85C00E8754E /* Shim.xcconfig */;
 			buildSettings = {
 				OTHER_LDFLAGS = (
 					"$(OTHER_LDFLAGS)",
 					"-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)",
 				);
+				PRODUCT_NAME = PluginProcessShim;
 			};
 			name = Debug;
 		};
 		1AC25FB212A48EA700BD2671 /* Release */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */;
+			baseConfigurationReference = 5183B3931379F85C00E8754E /* Shim.xcconfig */;
 			buildSettings = {
 				OTHER_LDFLAGS = (
 					"$(OTHER_LDFLAGS)",
 					"-l$(WEBKIT_SYSTEM_INTERFACE_LIBRARY)",
 				);
+				PRODUCT_NAME = PluginProcessShim;
 			};
 			name = Release;
 		};
 		1AC25FB312A48EA700BD2671 /* Production */ = {
 			isa = XCBuildConfiguration;
-			baseConfigurationReference = 1AC25FBB12A48EDA00BD2671 /* PluginProcessShim.xcconfig */;
+			baseConfigurationReference = 5183B3931379F85C00E8754E /* Shim.xcconfig */;
 			buildSettings = {
 				OTHER_LDFLAGS = (
 					"$(OTHER_LDFLAGS)",
 					"-lWebKitSystemInterface",
 				);
+				PRODUCT_NAME = PluginProcessShim;
 			};
 			name = Production;
 		};
@@ -4526,6 +4606,30 @@
 			};
 			name = Release;
 		};
+		510031F31379CACB00C8DFE4 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = 5183B3931379F85C00E8754E /* Shim.xcconfig */;
+			buildSettings = {
+				PRODUCT_NAME = WebProcessShim;
+			};
+			name = Debug;
+		};
+		510031F41379CACB00C8DFE4 /* Release */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = 5183B3931379F85C00E8754E /* Shim.xcconfig */;
+			buildSettings = {
+				PRODUCT_NAME = WebProcessShim;
+			};
+			name = Release;
+		};
+		510031F51379CACB00C8DFE4 /* Production */ = {
+			isa = XCBuildConfiguration;
+			baseConfigurationReference = 5183B3931379F85C00E8754E /* Shim.xcconfig */;
+			buildSettings = {
+				PRODUCT_NAME = WebProcessShim;
+			};
+			name = Production;
+		};
 		5D22D69B11A7534600BF30E5 /* Production */ = {
 			isa = XCBuildConfiguration;
 			baseConfigurationReference = 1A4F976A100E7B6600637A18 /* Base.xcconfig */;
@@ -4658,6 +4762,16 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Production;
 		};
+		510031F21379CACB00C8DFE4 /* Build configuration list for PBXNativeTarget "WebProcessShim" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				510031F31379CACB00C8DFE4 /* Debug */,
+				510031F41379CACB00C8DFE4 /* Release */,
+				510031F51379CACB00C8DFE4 /* Production */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Production;
+		};
 		BCDE093E13272496001259FB /* Build configuration list for PBXNativeTarget "PluginProcess" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (86677 => 86678)


--- trunk/Source/WebKit2/WebProcess/WebProcess.h	2011-05-17 17:05:55 UTC (rev 86677)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h	2011-05-17 17:12:37 UTC (rev 86678)
@@ -84,9 +84,13 @@
 
     bool isSeparateProcess() const;
 
-#if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC)
+#if PLATFORM(MAC)
+    void initializeShim();
+
+#if USE(ACCELERATED_COMPOSITING)
     mach_port_t compositingRenderServerPort() const { return m_compositingRenderServerPort; }
 #endif
+#endif
     
     void addVisitedLink(WebCore::LinkHash);
     bool isLinkVisited(WebCore::LinkHash) const;

Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm (86677 => 86678)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm	2011-05-17 17:05:55 UTC (rev 86677)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm	2011-05-17 17:12:37 UTC (rev 86678)
@@ -30,17 +30,19 @@
 #import "SandboxExtension.h"
 #import "WebPage.h"
 #import "WebProcessCreationParameters.h"
+#import "WebProcessShim.h"
 #import <WebCore/FileSystem.h>
+#import <WebCore/LocalizedStrings.h>
 #import <WebCore/MemoryCache.h>
 #import <WebCore/PageCache.h>
 #import <WebKitSystemInterface.h>
 #import <algorithm>
 #import <dispatch/dispatch.h>
+#import <dlfcn.h>
 #import <mach/host_info.h>
 #import <mach/mach.h>
 #import <mach/mach_error.h>
 #import <objc/runtime.h>
-#import <WebCore/LocalizedStrings.h>
 
 #if ENABLE(WEB_PROCESS_SANDBOX)
 #import <sandbox.h>
@@ -237,6 +239,15 @@
     method_setImplementation(methodToPatch, (IMP)NSApplicationAccessibilityFocusedUIElement);
 }
 
+void WebProcess::initializeShim()
+{
+    const WebProcessShimCallbacks callbacks = {
+    };
+    
+    WebProcessShimInitializeFunc initFunc = reinterpret_cast<WebProcessShimInitializeFunc>(dlsym(RTLD_DEFAULT, "WebKitWebProcessShimInitialize"));
+    initFunc(callbacks);
+}
+
 void WebProcess::platformTerminate()
 {
 }

Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm (86677 => 86678)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm	2011-05-17 17:05:55 UTC (rev 86677)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm	2011-05-17 17:12:37 UTC (rev 86678)
@@ -90,6 +90,9 @@
     WTF::initializeMainThread();
     RunLoop::initializeMainRunLoop();
 
+    // Initialize the shim.
+    WebProcess::shared().initializeShim();
+    
     // Create the connection.
     WebProcess::shared().initialize(serverPort, RunLoop::main());
 

Added: trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.h (0 => 86678)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.h	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.h	2011-05-17 17:12:37 UTC (rev 86678)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebProcessShim_h
+#define WebProcessShim_h
+
+namespace WebKit {
+
+struct WebProcessShimCallbacks {
+};
+
+typedef void (*WebProcessShimInitializeFunc)(const WebProcessShimCallbacks& callbacks);
+
+}
+
+#endif // WebProcessShim_h

Added: trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.mm (0 => 86678)


--- trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.mm	                        (rev 0)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessShim.mm	2011-05-17 17:12:37 UTC (rev 86678)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebProcessShim.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 };
+
+namespace WebKit {
+
+extern "C" void WebKitWebProcessShimInitialize(const WebProcessShimCallbacks&);
+
+__attribute__((visibility("default")))
+void WebKitWebProcessShimInitialize(const WebProcessShimCallbacks& callbacks)
+{
+}
+
+} // namespace WebKit
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to