diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 20:50:32 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-25 20:50:32 +0000 |
commit | c0478b0985b9893601125a88a32a648656a75948 (patch) | |
tree | 8af9f0dcb303cbcdbf0da4c134f025d4e7ddd238 /webkit/glue/plugins/gtk_plugin_container_manager.h | |
parent | d4eb7120deddccf96ff85ecc393b0757497bb7d6 (diff) | |
download | chromium_src-c0478b0985b9893601125a88a32a648656a75948.zip chromium_src-c0478b0985b9893601125a88a32a648656a75948.tar.gz chromium_src-c0478b0985b9893601125a88a32a648656a75948.tar.bz2 |
linux: new socket/plug code for windowed plugins
This CL reworks the GtkSocket/GtkPlug code for windowed plugins on linux. Instead of having the plugin ask the browser to create a socket to plug into, it simply creates a plug and sends it to the browser. The browser creates a socket and attaches the plug when the socket becomes realized
This fixes 2 main issues:
- we can create windowed plugins in background tabs (Issue 16125)
- we can detach tabs with windowed plugins and reattach them (Issue 17110)
I reworked the IPCs, so it removes some amount of linux-specific things. We also need less synchronous IPCs to create/destroy plugins, so that should be a bit faster. In particular, I removed the plugin pid map, and instead made sure the renderer always destroys the plugin containers if the plugin process crashes - they will be destroyed if the renderer process crashes. Let me know if you have an issue with that.
Also, the intermediate plug/socket creation now happens in webplugin_delegate_impl_gtk. That means test_shell uses it as well. It made the code a lot simpler, and means we're testing it as well, albeit with a bit of extra overhead.
Bonus: I found a big bad bug in the GtkPluginContainer that made its width/height alias with some internal gtk structures. That was certainly causing some amounts of bugs.
Bonus 2: scrolling now looks more in sync with the rest of the page, though I'm not exactly sure which part caused that.
BUG=16125,17110
TEST=a lot of manual testing involving YouTube videos
Review URL: http://codereview.chromium.org/174295
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24309 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins/gtk_plugin_container_manager.h')
-rw-r--r-- | webkit/glue/plugins/gtk_plugin_container_manager.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/webkit/glue/plugins/gtk_plugin_container_manager.h b/webkit/glue/plugins/gtk_plugin_container_manager.h index 648e963..30a6b1a 100644 --- a/webkit/glue/plugins/gtk_plugin_container_manager.h +++ b/webkit/glue/plugins/gtk_plugin_container_manager.h @@ -21,28 +21,31 @@ class GtkPluginContainerManager { // Sets the widget that will host the plugin containers. Must be a GtkFixed. void set_host_widget(GtkWidget *widget) { host_widget_ = widget; } - // Creates a new plugin container, returning its XID. - gfx::PluginWindowHandle CreatePluginContainer(); + // Creates a new plugin container, for a given plugin XID. + GtkWidget* CreatePluginContainer(gfx::PluginWindowHandle id); - // Destroys a plugin container, given its XID. - void DestroyPluginContainer(gfx::PluginWindowHandle container); + // Destroys a plugin container, given the plugin XID. + void DestroyPluginContainer(gfx::PluginWindowHandle id); // Takes an update from WebKit about a plugin's position and side and moves // the plugin accordingly. void MovePluginContainer(const WebPluginGeometry& move); private: - // Maps a plugin container XID to the corresponding widget. + // Maps a plugin XID to the corresponding container widget. GtkWidget* MapIDToWidget(gfx::PluginWindowHandle id); - // Callback for when the plugin container loses its XID, so that it can be - // removed from plugin_window_to_widget_map_. - static void UnrealizeCallback(GtkWidget *widget, void *user_data); + // Maps a container widget to the corresponding plugin XID. + gfx::PluginWindowHandle MapWidgetToID(GtkWidget* widget); + + // Callback for when the plugin container gets realized, at which point it + // plugs the plugin XID. + static void RealizeCallback(GtkWidget *widget, void *user_data); // Parent of the plugin containers. GtkWidget* host_widget_; - // A map that associates plugin containers to their XID. + // A map that associates plugin containers to the plugin XID. typedef std::map<gfx::PluginWindowHandle, GtkWidget*> PluginWindowToWidgetMap; PluginWindowToWidgetMap plugin_window_to_widget_map_; }; |