From 140c303f6227f870bb269bd6810c907c99004b55 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Fri, 26 Jun 2009 18:22:54 +0000 Subject: linux plugins: eliminate GtkWidget* from plugin process [retry with mac hopefully fixed this time] GtkWidget* (and its wrapper, gfx::NativeView) only work within a single process. Plugins already work with a lower-level type that works across processes -- an X Window id. The parent of a plugin is an HWND on windows, but it's an X Window id on X. So we introduce a new typedef wrapping that and push it through all the places in the code that needs it. Since we no longer have a GtkSocket in the WebPluginDelegateImpl, we need to do a bit more work in the WebViewDelegate (aka the browser process in the multiproc world). We also need the plugin host (the browser) to track the GtkSockets that are hosting the plugin, as well as destroy them when necessary. To do this we require the plugin owner to grab the plug-removed signal rather than putting its handler in GtkPluginContainer; this is the way it worked before I'd refactored into GtkPluginContainer so it shouldn't be so bad. This change still only works in test_shell, but the refactoring should translate to the multiprocess case pretty easily. Review URL: http://codereview.chromium.org/146009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19387 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/plugin/webplugin_proxy.cc | 10 ++++++++-- chrome/plugin/webplugin_proxy.h | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'chrome/plugin') diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc index 286659b..57c07fc 100644 --- a/chrome/plugin/webplugin_proxy.cc +++ b/chrome/plugin/webplugin_proxy.cc @@ -56,15 +56,21 @@ bool WebPluginProxy::Send(IPC::Message* msg) { return channel_->Send(msg); } -void WebPluginProxy::SetWindow(gfx::NativeView window) { +void WebPluginProxy::SetWindow(gfx::PluginWindowHandle window) { +#if defined(OS_WIN) Send(new PluginHostMsg_SetWindow(route_id_, gfx::IdFromNativeView(window))); +#else + NOTIMPLEMENTED(); +#endif } -void WebPluginProxy::WillDestroyWindow(gfx::NativeView window) { +void WebPluginProxy::WillDestroyWindow(gfx::PluginWindowHandle window) { #if defined(OS_WIN) PluginThread::current()->Send( new PluginProcessHostMsg_PluginWindowDestroyed( window, ::GetParent(window))); +#else + NOTIMPLEMENTED(); #endif } diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h index 46c16d1..e143297 100644 --- a/chrome/plugin/webplugin_proxy.h +++ b/chrome/plugin/webplugin_proxy.h @@ -37,8 +37,8 @@ class WebPluginProxy : public WebPlugin { ~WebPluginProxy(); // WebPlugin overrides - void SetWindow(gfx::NativeView window); - void WillDestroyWindow(gfx::NativeView window); + void SetWindow(gfx::PluginWindowHandle window); + void WillDestroyWindow(gfx::PluginWindowHandle window); #if defined(OS_WIN) void SetWindowlessPumpEvent(HANDLE pump_messages_event); // Returns true on success. -- cgit v1.1