Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Issue 146009: linux plugins: eliminate GtkWidget* from plugin process (Closed)

Created:
11 years, 6 months ago by Evan Martin
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

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.

Patch Set 1 #

Patch Set 2 : wip #

Patch Set 3 : cleaner #

Total comments: 1

Patch Set 4 : now works, conceptually #

Patch Set 5 : fleshed out, crashes in GDK_DISPLAY (?) #

Patch Set 6 : hacks #

Patch Set 7 : one more hack #

Patch Set 8 : works, almost! #

Patch Set 9 : add note so i don't forget piman comment #

Patch Set 10 : clean up diff #

Patch Set 11 : clean #

Patch Set 12 : flash doesn't crash anymore #

Total comments: 9

Patch Set 13 : ok #

Total comments: 3

Patch Set 14 : renamed #

Patch Set 15 : shutdown works #

Patch Set 16 : retry #

Unified diffs Side-by-side diffs Delta from patch set Stats (+181 lines, -87 lines) Patch
M base/gfx/native_widget_types.h View 11 12 13 14 15 1 chunk +15 lines, -0 lines 0 comments Download
M chrome/common/ipc_message_utils.h View 12 13 14 15 1 chunk +21 lines, -0 lines 0 comments Download
M chrome/plugin/webplugin_proxy.h View 12 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/plugin/webplugin_proxy.cc View 12 1 chunk +8 lines, -2 lines 0 comments Download
M webkit/glue/plugins/gtk_plugin_container.cc View 4 chunks +1 line, -15 lines 0 comments Download
M webkit/glue/plugins/plugin_host.cc View 11 12 1 chunk +1 line, -1 line 0 comments Download
M webkit/glue/plugins/plugin_instance.h View 11 12 2 chunks +5 lines, -3 lines 0 comments Download
M webkit/glue/plugins/webplugin_delegate_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +3 lines, -3 lines 0 comments Download
M webkit/glue/plugins/webplugin_delegate_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -2 lines 0 comments Download
M webkit/glue/plugins/webplugin_delegate_impl_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +16 lines, -39 lines 0 comments Download
M webkit/glue/webplugin.h View 11 12 2 chunks +5 lines, -3 lines 0 comments Download
M webkit/glue/webplugin_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -3 lines 0 comments Download
M webkit/glue/webplugin_impl.h View 11 12 2 chunks +3 lines, -3 lines 0 comments Download
M webkit/glue/webplugin_impl.cc View 11 12 1 chunk +1 line, -1 line 0 comments Download
M webkit/tools/test_shell/test_webview_delegate_gtk.cc View 4 5 6 7 8 9 10 11 12 13 14 5 chunks +29 lines, -10 lines 0 comments Download
M webkit/tools/test_shell/webview_host.h View 8 9 10 11 3 chunks +30 lines, -0 lines 0 comments Download
M webkit/tools/test_shell/webview_host_gtk.cc View 8 9 10 11 2 chunks +37 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Evan Martin
Not ready for commit, just showing where I'm headed. Unfortunately the WebPluginDelegateImpl API is such ...
11 years, 6 months ago (2009-06-23 01:08:53 UTC) #1
Evan Martin
Ok, now I've got enough working so you can see where moving/resizing will need to ...
11 years, 6 months ago (2009-06-23 02:02:21 UTC) #2
Evan Martin
On 2009/06/23 02:02:21, Evan Martin wrote: > Ok, now I've got enough working so you ...
11 years, 6 months ago (2009-06-23 02:02:44 UTC) #3
Antoine Labour
It looks promising ! http://codereview.chromium.org/146009/diff/10/1009 File webkit/glue/plugins/webplugin_delegate_impl_gtk.cc (right): http://codereview.chromium.org/146009/diff/10/1009#newcode126 Line 126: // TODO(evanm): figure out ...
11 years, 6 months ago (2009-06-23 02:26:21 UTC) #4
Evan Martin
Still not ready for commit, but FYI this code now works again. The plugin impl ...
11 years, 6 months ago (2009-06-24 01:30:19 UTC) #5
Evan Martin
I believe this is ready for commit. John: please take a look at all the ...
11 years, 6 months ago (2009-06-25 18:06:29 UTC) #6
Antoine Labour
http://codereview.chromium.org/146009/diff/1044/2010 File webkit/glue/plugins/webplugin_delegate_impl_gtk.cc (right): http://codereview.chromium.org/146009/diff/1044/2010#newcode280 Line 280: extra->colormap = DefaultColormap(GDK_DISPLAY(), 0); For visual, depth, and ...
11 years, 6 months ago (2009-06-25 18:22:05 UTC) #7
jam
lgtm, just nitting http://codereview.chromium.org/146009/diff/1044/2001 File base/gfx/native_widget_types.h (right): http://codereview.chromium.org/146009/diff/1044/2001#newcode119 Line 119: namespace NPAPI { I think ...
11 years, 6 months ago (2009-06-25 18:25:35 UTC) #8
Antoine Labour
http://codereview.chromium.org/146009/diff/1044/2003 File chrome/plugin/webplugin_proxy.cc (right): http://codereview.chromium.org/146009/diff/1044/2003#newcode61 Line 61: Send(new PluginHostMsg_SetWindow(route_id_, gfx::IdFromNativeView(window))); On 2009/06/25 18:25:35, John Abd-El-Malek ...
11 years, 6 months ago (2009-06-25 19:09:51 UTC) #9
Antoine Labour
http://codereview.chromium.org/146009/diff/1049/1064 File webkit/tools/test_shell/test_webview_delegate_gtk.cc (right): http://codereview.chromium.org/146009/diff/1049/1064#newcode96 Line 96: shell_->webViewHost()->CreatePluginContainer(); Thinking about this some more... this breaks ...
11 years, 6 months ago (2009-06-25 19:45:16 UTC) #10
Evan Martin
not ready to go due to Antoine's last comment, but the rest fixed. http://codereview.chromium.org/146009/diff/1044/2001 File ...
11 years, 6 months ago (2009-06-25 20:59:11 UTC) #11
Antoine Labour
http://codereview.chromium.org/146009/diff/1049/1064 File webkit/tools/test_shell/test_webview_delegate_gtk.cc (right): http://codereview.chromium.org/146009/diff/1049/1064#newcode96 Line 96: shell_->webViewHost()->CreatePluginContainer(); On 2009/06/25 20:59:12, Evan Martin wrote: > ...
11 years, 6 months ago (2009-06-25 21:55:19 UTC) #12
Evan Martin
I've uploaded a new version that shuts down ok. Would you mind if I commit ...
11 years, 6 months ago (2009-06-25 23:36:27 UTC) #13
Antoine Labour
11 years, 6 months ago (2009-06-26 00:08:42 UTC) #14
On 2009/06/25 23:36:27, Evan Martin wrote:
> I've uploaded a new version that shuts down ok.
> 
> Would you mind if I commit this, then tackle the refactoring to get the socket
> creation fixed for windowless in a subsequent change?  It still displays right
> now and doesn't crash so I think it's ok...

Yeah, that's ok. LGTM.

Powered by Google App Engine
This is Rietveld 408576698