+2012-04-16 Anders Carlsson <andersca@apple.com>
+
+ Use a MIG call when creating a plug-in property list file
+ https://bugs.webkit.org/show_bug.cgi?id=84084
+ <rdar://problem/11197341>
+
+ Reviewed by Sam Weinig.
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::createPropertyListFile):
+ Get a plug-in host and call _WKPHCreatePluginMIMETypesPreferences instead.
+
+ * Plugins/Hosted/WebKitPluginHost.defs:
+ Add PHCreatePluginMIMETypesPreferences.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage createPropertyListFile]):
+ NetscapePluginHostManager::createPropertyListFile is no longer a static member function.
+
2012-04-12 Andy Estes <aestes@apple.com>
REGRESSION (r102262): iAd Producer relies on CSSStyleDeclaration property setters respecting '!important'
return instance.release();
}
-void NetscapePluginHostManager::createPropertyListFile(const String& pluginPath, cpu_type_t pluginArchitecture)
-{
- NSString *pluginHostAppPath = [[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] pathForAuxiliaryExecutable:pluginHostAppName];
- NSString *pluginHostAppExecutablePath = [[NSBundle bundleWithPath:pluginHostAppPath] executablePath];
- NSString *bundlePath = pluginPath;
+void NetscapePluginHostManager::createPropertyListFile(const String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier)
+{
+ NetscapePluginHostProxy* hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier);
+ if (!hostProxy)
+ return;
- pid_t pid;
- posix_spawnattr_t attr;
- posix_spawnattr_init(&attr);
-
- // Set the architecture.
- size_t ocount = 0;
- int cpuTypes[] = { pluginArchitecture };
- posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &ocount);
-
- // Spawn the plug-in host and tell it to call the registration function.
- const char* args[] = { [pluginHostAppExecutablePath fileSystemRepresentation], "-createPluginMIMETypesPreferences", [bundlePath fileSystemRepresentation], 0 };
-
- int result = posix_spawn(&pid, args[0], 0, &attr, const_cast<char* const*>(args), 0);
- posix_spawnattr_destroy(&attr);
-
- if (!result && pid > 0) {
- // Wait for the process to finish.
- while (waitpid(pid, 0, 0) == -1) { }
- }
+ _WKPHCreatePluginMIMETypesPreferences(hostProxy->port());
}
void NetscapePluginHostManager::didCreateWindow()