[X11] Plugin process crashes in NetscapePlugin::platformPostInitialize()
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Oct 2014 16:58:48 +0000 (16:58 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Oct 2014 16:58:48 +0000 (16:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137426

Reviewed by Darin Adler.

For some reason flash crashes when NPP_GetValue is called with
NPPVpluginCancelSrcStream, but only in windowed mode. Not calling
NPP_GetValue and unconditionally loading the source URL in the
browser fixes the crash and plugins work normally. We can handle
this particular case with a new quirk.

* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
(WebKit::NetscapePluginModule::determineQuirks): Add
DoNotCancelSrcStreamInWindowedMode quirk if it's flash plugin.
* Shared/Plugins/PluginQuirks.h: Add
DoNotCancelSrcStreamInWindowedMode quirk.
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::shouldLoadSrcURL): Return early if plugin
is windowed and DoNotCancelSrcStreamInWindowedMode quirk is present.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174507 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
Source/WebKit2/Shared/Plugins/PluginQuirks.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

index 88080b5..9919bbf 100644 (file)
@@ -1,3 +1,25 @@
+2014-10-09  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [X11] Plugin process crashes in NetscapePlugin::platformPostInitialize()
+        https://bugs.webkit.org/show_bug.cgi?id=137426
+
+        Reviewed by Darin Adler.
+
+        For some reason flash crashes when NPP_GetValue is called with
+        NPPVpluginCancelSrcStream, but only in windowed mode. Not calling
+        NPP_GetValue and unconditionally loading the source URL in the
+        browser fixes the crash and plugins work normally. We can handle
+        this particular case with a new quirk.
+
+        * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
+        (WebKit::NetscapePluginModule::determineQuirks): Add
+        DoNotCancelSrcStreamInWindowedMode quirk if it's flash plugin.
+        * Shared/Plugins/PluginQuirks.h: Add
+        DoNotCancelSrcStreamInWindowedMode quirk.
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::shouldLoadSrcURL): Return early if plugin
+        is windowed and DoNotCancelSrcStreamInWindowedMode quirk is present.
+
 2014-10-09  Chris Dumez  <cdumez@apple.com>
 
         Use is<>() / downcast<>() for Widget subclasses
index eced05b..3627539 100644 (file)
@@ -189,6 +189,7 @@ void NetscapePluginModule::determineQuirks()
 #if PLATFORM(EFL)
             m_pluginQuirks.add(PluginQuirks::ForceFlashWindowlessMode);
 #endif
+            m_pluginQuirks.add(PluginQuirks::DoNotCancelSrcStreamInWindowedMode);
             break;
         }
     }
index 9274015..2c8df27 100644 (file)
@@ -92,6 +92,9 @@ public:
         // Some ports don't support windowed plugins.
         ForceFlashWindowlessMode,
 
+        // Flash crashes when NPP_GetValue is called for NPPVpluginCancelSrcStream in windowed mode.
+        DoNotCancelSrcStreamInWindowedMode,
+
         // Windows specific quirks:
 #elif PLUGIN_ARCHITECTURE(WIN)
         // Whether NPN_UserAgent should always return a Mozilla user agent.
index dc0f982..9405e52 100644 (file)
@@ -507,6 +507,12 @@ void NetscapePlugin::callSetWindowInvisible()
 
 bool NetscapePlugin::shouldLoadSrcURL()
 {
+#if PLUGIN_ARCHITECTURE(X11)
+    // Flash crashes when NPP_GetValue is called for NPPVpluginCancelSrcStream in windowed mode.
+    if (m_isWindowed && m_pluginModule->pluginQuirks().contains(PluginQuirks::DoNotCancelSrcStreamInWindowedMode))
+        return true;
+#endif
+
     // Check if we should cancel the load
     NPBool cancelSrcStream = false;