Title: [102958] trunk/Source/WebCore
Revision
102958
Author
[email protected]
Date
2011-12-15 10:28:29 -0800 (Thu, 15 Dec 2011)

Log Message

plugin crash

[GTK] Plugins sometimes crash WebKitGTK+ with Gdk-CRITICAL **: gdk_window_get_toplevel: assertion `GDK_IS_WINDOW (window)' failed
https://bugs.webkit.org/show_bug.cgi?id=73719

Patch by Martin Robinson <[email protected]> on 2011-12-15
Reviewed by Philippe Normand.

No new tests. It's difficult to test or reproduce this exact situation
as it only occurs when running plugins under nspluginwrapper.

* plugins/gtk/PluginViewGtk.cpp:
(WebCore::PluginView::platformGetValue): Properly handle when the plugin tries to
get the window value when the GtkSocket is no longer realized.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (102957 => 102958)


--- trunk/Source/WebCore/ChangeLog	2011-12-15 18:21:31 UTC (rev 102957)
+++ trunk/Source/WebCore/ChangeLog	2011-12-15 18:28:29 UTC (rev 102958)
@@ -1,3 +1,19 @@
+2011-12-15  Martin Robinson  <[email protected]>
+
+        plugin crash
+
+        [GTK] Plugins sometimes crash WebKitGTK+ with Gdk-CRITICAL **: gdk_window_get_toplevel: assertion `GDK_IS_WINDOW (window)' failed
+        https://bugs.webkit.org/show_bug.cgi?id=73719
+
+        Reviewed by Philippe Normand.
+
+        No new tests. It's difficult to test or reproduce this exact situation
+        as it only occurs when running plugins under nspluginwrapper.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::PluginView::platformGetValue): Properly handle when the plugin tries to
+        get the window value when the GtkSocket is no longer realized.
+
 2011-12-15  Martin Kosiba  <[email protected]>
 
         Fix find on web pages with -webkit-user-select: none for Chromium

Modified: trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp (102957 => 102958)


--- trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp	2011-12-15 18:21:31 UTC (rev 102957)
+++ trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp	2011-12-15 18:28:29 UTC (rev 102958)
@@ -710,7 +710,12 @@
         case NPNVnetscapeWindow: {
             GdkWindow* gdkWindow = gtk_widget_get_window(m_parentFrame->view()->hostWindow()->platformPageClient());
 #if defined(XP_UNIX)
-            *static_cast<Window*>(value) = GDK_WINDOW_XWINDOW(gdk_window_get_toplevel(gdkWindow));
+            GdkWindow* toplevelWindow = gdk_window_get_toplevel(gdkWindow);
+            if (!toplevelWindow) {
+                *result = NPERR_GENERIC_ERROR;
+                return true;
+            }
+            *static_cast<Window*>(value) = GDK_WINDOW_XWINDOW(toplevelWindow);
 #elif defined(GDK_WINDOWING_WIN32)
             *static_cast<HGDIOBJ*>(value) = GDK_WINDOW_HWND(gdkWindow);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to