Title: [185274] trunk/Source/WebKit2
Revision
185274
Author
[email protected]
Date
2015-06-05 16:49:43 -0700 (Fri, 05 Jun 2015)

Log Message

Only allow plug-ins to create custom MIME property lists on older versions of OS X
https://bugs.webkit.org/show_bug.cgi?id=145716

Reviewed by Dan Bernstein.

* PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
* Shared/Plugins/Netscape/NetscapePluginModule.h:
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getMIMETypesFromPluginBundle):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (185273 => 185274)


--- trunk/Source/WebKit2/ChangeLog	2015-06-05 23:20:06 UTC (rev 185273)
+++ trunk/Source/WebKit2/ChangeLog	2015-06-05 23:49:43 UTC (rev 185274)
@@ -1,3 +1,17 @@
+2015-06-05  Anders Carlsson  <[email protected]>
+
+        Only allow plug-ins to create custom MIME property lists on older versions of OS X
+        https://bugs.webkit.org/show_bug.cgi?id=145716
+
+        Reviewed by Dan Bernstein.
+
+        * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
+        * Shared/Plugins/Netscape/NetscapePluginModule.h:
+        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
+        (WebKit::getMIMETypesFromPluginBundle):
+        * UIProcess/Plugins/PluginProcessProxy.h:
+        * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
+
 2015-06-05  Chris Dumez  <[email protected]>
 
         [WK2][iOS] Limit the number of vnodes used by the WebContent processes

Modified: trunk/Source/WebKit2/PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm (185273 => 185274)


--- trunk/Source/WebKit2/PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm	2015-06-05 23:20:06 UTC (rev 185273)
+++ trunk/Source/WebKit2/PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm	2015-06-05 23:49:43 UTC (rev 185274)
@@ -74,6 +74,7 @@
         [NSApp _installAutoreleasePoolsOnCurrentThreadIfNecessary];
 #endif
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
         // Check if we're being spawned to write a MIME type preferences file.
         String pluginPath = m_commandLine["createPluginMIMETypesPreferences"];
         if (!pluginPath.isEmpty()) {
@@ -84,6 +85,7 @@
                 exit(EXIT_FAILURE);
             exit(EXIT_SUCCESS);
         }
+#endif
     }
 
     virtual bool getExtraInitializationData(HashMap<String, String>& extraInitializationData) override

Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h (185273 => 185274)


--- trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h	2015-06-05 23:20:06 UTC (rev 185273)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h	2015-06-05 23:49:43 UTC (rev 185274)
@@ -65,7 +65,7 @@
 
     Module* module() const { return m_module.get(); }
 
-#if PLUGIN_ARCHITECTURE(MAC)
+#if PLUGIN_ARCHITECTURE(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
     static bool createPluginMIMETypesPreferences(const String& pluginPath);
 #endif
 

Modified: trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm (185273 => 185274)


--- trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm	2015-06-05 23:20:06 UTC (rev 185273)
+++ trunk/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm	2015-06-05 23:49:43 UTC (rev 185274)
@@ -92,6 +92,7 @@
     return false;
 }
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 static RetainPtr<CFDictionaryRef> contentsOfPropertyListAtURL(CFURLRef propertyListURL)
 {
     RetainPtr<NSData> propertyListData = adoptNS([[NSData alloc] initWithContentsOfURL:(NSURL *)propertyListURL]);
@@ -107,9 +108,11 @@
 
     return static_cast<CFDictionaryRef>(propertyList.get());
 }
+#endif
 
 static RetainPtr<CFDictionaryRef> getMIMETypesFromPluginBundle(CFBundleRef bundle, const PluginModuleInfo& plugin)
 {
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
     CFStringRef propertyListFilename = static_cast<CFStringRef>(CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginMIMETypesFilename")));
     if (propertyListFilename) {
         RetainPtr<CFStringRef> propertyListPath = adoptCF(CFStringCreateWithFormat(kCFAllocatorDefault, 0, CFSTR("%@/Library/Preferences/%@"), NSHomeDirectory(), propertyListFilename));
@@ -125,6 +128,7 @@
         
         return static_cast<CFDictionaryRef>(CFDictionaryGetValue(propertyList.get(), CFSTR("WebPluginMIMETypes")));
     }
+#endif
     
     return static_cast<CFDictionaryRef>(CFBundleGetValueForInfoDictionaryKey(bundle, CFSTR("WebPluginMIMETypes")));
 }
@@ -408,6 +412,7 @@
     return true;
 }
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 bool NetscapePluginModule::createPluginMIMETypesPreferences(const String& pluginPath)
 {
     RetainPtr<CFURLRef> bundleURL = adoptCF(CFURLCreateWithFileSystemPath(kCFAllocatorDefault, pluginPath.createCFString().get(), kCFURLPOSIXPathStyle, false));
@@ -426,6 +431,7 @@
     createPluginMIMETypesPreferences();
     return true;
 }
+#endif
 
 // FIXME: This doesn't need to be platform-specific.
 class PluginVersion {

Modified: trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h (185273 => 185274)


--- trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h	2015-06-05 23:20:06 UTC (rev 185273)
+++ trunk/Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.h	2015-06-05 23:49:43 UTC (rev 185274)
@@ -93,10 +93,13 @@
     // Returns whether the plug-in needs the heap to be marked executable.
     static bool pluginNeedsExecutableHeap(const PluginModuleInfo&);
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
     // Creates a property list in ~/Library/Preferences that contains all the MIME types supported by the plug-in.
     static bool createPropertyListFile(const PluginModuleInfo&);
 #endif
 
+#endif
+
 #if PLUGIN_ARCHITECTURE(X11)
     static bool scanPlugin(const String& pluginPath, RawPluginMetaData& result);
 #endif

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


--- trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm	2015-06-05 23:20:06 UTC (rev 185273)
+++ trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm	2015-06-05 23:49:43 UTC (rev 185274)
@@ -77,6 +77,7 @@
     return false;
 }
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000
 bool PluginProcessProxy::createPropertyListFile(const PluginModuleInfo& plugin)
 {
     NSBundle *webKit2Bundle = [NSBundle bundleWithIdentifier:@"com.apple.WebKit"];
@@ -126,6 +127,7 @@
 
     return true;
 }
+#endif
 
 static bool shouldUseXPC(ProcessLauncher::LaunchOptions& launchOptions, const PluginProcessAttributes& pluginProcessAttributes)
 {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to