Title: [196457] trunk/Source/WebKit2
Revision
196457
Author
[email protected]
Date
2016-02-11 16:40:17 -0800 (Thu, 11 Feb 2016)

Log Message

Use the system PluginProcess.app for generating plug-in MIME type preferences
https://bugs.webkit.org/show_bug.cgi?id=154139

Reviewed by Dan Bernstein.

* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::createPropertyListFile):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (196456 => 196457)


--- trunk/Source/WebKit2/ChangeLog	2016-02-12 00:31:53 UTC (rev 196456)
+++ trunk/Source/WebKit2/ChangeLog	2016-02-12 00:40:17 UTC (rev 196457)
@@ -1,3 +1,13 @@
+2016-02-11  Anders Carlsson  <[email protected]>
+
+        Use the system PluginProcess.app for generating plug-in MIME type preferences
+        https://bugs.webkit.org/show_bug.cgi?id=154139
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
+        (WebKit::PluginProcessProxy::createPropertyListFile):
+
 2016-02-11  Beth Dakin  <[email protected]>
 
         EditingRangeIsRelativeTo::Document and NSRangeIsRelativeTo::Document should 

Modified: trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm (196456 => 196457)


--- trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm	2016-02-12 00:31:53 UTC (rev 196456)
+++ trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm	2016-02-12 00:40:17 UTC (rev 196457)
@@ -28,8 +28,6 @@
 
 #if ENABLE(NETSCAPE_PLUGIN_API)
 
-#import "DynamicLinkerEnvironmentExtractor.h"
-#import "EnvironmentVariables.h"
 #import "PluginProcessCreationParameters.h"
 #import "PluginProcessMessages.h"
 #import "SandboxUtilities.h"
@@ -80,13 +78,6 @@
 #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 bool PluginProcessProxy::createPropertyListFile(const PluginModuleInfo& plugin)
 {
-    NSBundle *webKit2Bundle = [NSBundle bundleWithIdentifier:@"com.apple.WebKit"];
-    NSString *frameworksPath = [[webKit2Bundle bundlePath] stringByDeletingLastPathComponent];
-    const char* frameworkExecutablePath = [[webKit2Bundle executablePath] fileSystemRepresentation];
-    
-    NSString *processPath = [webKit2Bundle pathForAuxiliaryExecutable:@"PluginProcess.app"];
-    NSString *processAppExecutablePath = [[NSBundle bundleWithPath:processPath] executablePath];
-
     CString pluginPathString = fileSystemRepresentation(plugin.path);
 
     posix_spawnattr_t attr;
@@ -96,21 +87,12 @@
     size_t outCount = 0;
     posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &outCount);
 
-    EnvironmentVariables environmentVariables;
+    posix_spawnattr_setflags(&attr, POSIX_SPAWN_CLOEXEC_DEFAULT);
 
-    DynamicLinkerEnvironmentExtractor environmentExtractor([[NSBundle mainBundle] executablePath], _NSGetMachExecuteHeader()->cputype);
-    environmentExtractor.getExtractedEnvironmentVariables(environmentVariables);
-    
-    // To make engineering builds work, if the path is outside of /System set up
-    // DYLD_FRAMEWORK_PATH to pick up other frameworks, but don't do it for the
-    // production configuration because it involves extra file system access.
-    if (![frameworksPath hasPrefix:@"/System/"])
-        environmentVariables.appendValue("DYLD_FRAMEWORK_PATH", [frameworksPath fileSystemRepresentation], ':');
+    const char* args[] = { "/System/Library/Frameworks/WebKit.framework/PluginProcess.app/Contents/MacOS/PluginProcess", "/System/Library/Frameworks/WebKit.framework/WebKit", "-type", "pluginprocess", "-createPluginMIMETypesPreferences", pluginPathString.data(), 0 };
 
-    const char* args[] = { [processAppExecutablePath fileSystemRepresentation], frameworkExecutablePath, "-type", "pluginprocess", "-createPluginMIMETypesPreferences", pluginPathString.data(), 0 };
-
     pid_t pid;
-    int result = posix_spawn(&pid, args[0], 0, &attr, const_cast<char* const*>(args), environmentVariables.environmentPointer());
+    int result = posix_spawn(&pid, args[0], 0, &attr, const_cast<char* const*>(args), nullptr);
     posix_spawnattr_destroy(&attr);
 
     if (result)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to