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

Issue 146078: linux: OOP windowed plugins (Closed)

Created:
11 years, 6 months ago by Antoine Labour
Modified:
9 years, 7 months ago
Reviewers:
jam, Evan Martin
CC:
chromium-reviews_googlegroups.com, Dean McNamee, Amanda Walker
Visibility:
Public.

Description

linux: OOP windowed plugins There are still a few issues, but that's a start. - only windowed plugins - we can't currently create the gtksocket in background tabs, because their gtkwidgets are not yet in the hierarchy, so they can't be realized (that's what gives the XID). - the plugin process talks to the browser process through the renderer process to create/destroy the gtksockets, because the plugin doesn't know which renderer it's talking to. We need a bit more plumbing to be able to have direct IPC. - some code is duplicated between chrome and test_shell. We should probably refactor it, but I'm not sure where the common part should live. Patch from Antoine Labour <piman@google.com>;, with some touchups by me.

Patch Set 1 #

Patch Set 2 : some cleanup #

Patch Set 3 : Cleanup, update to plug into CreatePluginContainer/WillDestroyWindow #

Patch Set 4 : Fix test #

Total comments: 21

Patch Set 5 : Address review comments #

Patch Set 6 : Merge with trunk #

Total comments: 21

Patch Set 7 : new version #

Patch Set 8 : new version #

Unified diffs Side-by-side diffs Delta from patch set Stats (+382 lines, -143 lines) Patch
M chrome/browser/plugin_process_host.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/plugin_process_host.cc View 5 6 4 chunks +17 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host.cc View 2 chunks +18 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_gtk.h View 1 2 3 4 5 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_widget_host_view_gtk.cc View 1 2 3 4 5 6 6 chunks +17 lines, -3 lines 0 comments Download
M chrome/browser/renderer_host/test/test_render_view_host.h View 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/plugin_messages_internal.h View 2 3 4 3 chunks +21 lines, -1 line 0 comments Download
M chrome/common/render_messages_internal.h View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/plugin/plugin_main.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M chrome/plugin/webplugin_delegate_stub.cc View 1 2 3 4 5 6 1 chunk +7 lines, -6 lines 0 comments Download
M chrome/plugin/webplugin_proxy.h View 1 chunk +1 line, -3 lines 0 comments Download
M chrome/plugin/webplugin_proxy.cc View 1 2 6 chunks +13 lines, -12 lines 0 comments Download
M chrome/renderer/webplugin_delegate_proxy.h View 2 1 chunk +5 lines, -1 line 0 comments Download
M chrome/renderer/webplugin_delegate_proxy.cc View 1 2 3 4 5 6 2 chunks +22 lines, -7 lines 0 comments Download
A webkit/glue/plugins/gtk_plugin_container_host.h View 1 chunk +48 lines, -0 lines 0 comments Download
A webkit/glue/plugins/gtk_plugin_container_host.cc View 1 chunk +138 lines, -0 lines 0 comments Download
M webkit/glue/plugins/webplugin_delegate_impl_gtk.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M webkit/tools/test_shell/test_webview_delegate_gtk.cc View 1 2 chunks +4 lines, -56 lines 0 comments Download
M webkit/tools/test_shell/webview_host.h View 1 5 6 3 chunks +11 lines, -19 lines 0 comments Download
M webkit/tools/test_shell/webview_host_gtk.cc View 1 2 chunks +3 lines, -34 lines 0 comments Download
M webkit/webkit.gyp View 5 6 2 chunks +4 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
Antoine Labour
evan: review others: FYI, but feel free to chime in.
11 years, 5 months ago (2009-07-01 00:59:40 UTC) #1
Evan Martin
John and I were just discussing this problem, that "the plugin process talks to the ...
11 years, 5 months ago (2009-07-01 01:42:32 UTC) #2
Antoine Labour
On 2009/07/01 01:42:32, Evan Martin wrote: > John and I were just discussing this problem, ...
11 years, 5 months ago (2009-07-01 02:32:24 UTC) #3
jam
http://codereview.chromium.org/146078/diff/3020/4005 File chrome/app/chrome_dll_main.cc (right): http://codereview.chromium.org/146078/diff/3020/4005#newcode474 Line 474: gtk_init(&argc, const_cast<char***>(&argv)); nit: I think this belongs in ...
11 years, 5 months ago (2009-07-01 02:35:37 UTC) #4
Antoine Labour
http://codereview.chromium.org/146078/diff/3020/4005 File chrome/app/chrome_dll_main.cc (right): http://codereview.chromium.org/146078/diff/3020/4005#newcode474 Line 474: gtk_init(&argc, const_cast<char***>(&argv)); On 2009/07/01 02:35:38, John Abd-El-Malek wrote: ...
11 years, 5 months ago (2009-07-01 07:23:59 UTC) #5
jam
lgtm http://codereview.chromium.org/146078/diff/3077/3078 File chrome/browser/plugin_process_host.cc (right): http://codereview.chromium.org/146078/diff/3077/3078#newcode297 Line 297: void PluginProcessHost::OnMapNativeViewId(gfx::NativeViewId id, nit: better to put ...
11 years, 5 months ago (2009-07-01 17:09:30 UTC) #6
Evan Martin
11 years, 5 months ago (2009-07-03 01:23:17 UTC) #7
Really sorry, this slipped off my radar.  If I don't review something within an
hour or so in the future please ping me again.

http://codereview.chromium.org/146078/diff/3077/3080
File chrome/browser/renderer_host/render_view_host.cc (right):

http://codereview.chromium.org/146078/diff/3077/3080#newcode658
Line 658: #if defined(OS_WIN)
Put a comment in here about why this doesn't apply to mac/linux.

http://codereview.chromium.org/146078/diff/3077/3084
File chrome/browser/renderer_host/render_widget_host_view_gtk.cc (right):

http://codereview.chromium.org/146078/diff/3077/3084#newcode38
Line 38: gtk_fixed_set_has_window(GTK_FIXED(widget), true);
s/true/TRUE/

http://codereview.chromium.org/146078/diff/3077/3084#newcode478
Line 478: return;
this test isn't necessary anymore

http://codereview.chromium.org/146078/diff/3077/3084#newcode479
Line 479: for (unsigned int i = 0; i < plugin_window_moves.size(); ++i) {
use size_t for iterator

http://codereview.chromium.org/146078/diff/3077/3085
File chrome/browser/renderer_host/render_widget_host_view_gtk.h (right):

http://codereview.chromium.org/146078/diff/3077/3085#newcode19
Line 19: class GtkPluginContainerHost;
this forward declare doesn't seem necessary, since you're including the full
header above

http://codereview.chromium.org/146078/diff/3077/3085#newcode24
Line 24: typedef struct _GtkSocket GtkSocket;
this forward declare doesn't seem necessary?

http://codereview.chromium.org/146078/diff/3077/3089
File chrome/plugin/plugin_main.cc (right):

http://codereview.chromium.org/146078/diff/3077/3089#newcode82
Line 82: gtk_init(&argc, const_cast<char***>(&argv_pointer));
Didn't you already add a gtk_init elsewhere?

are we concerned about gtk mutating the strings passed in?  i know it'll munge
argv to extract its own flags.  i thought the earlier call to gtk_init was
nearer to main() which made this easier.

http://codereview.chromium.org/146078/diff/3077/3093
File chrome/renderer/webplugin_delegate_proxy.cc (right):

http://codereview.chromium.org/146078/diff/3077/3093#newcode647
Line 647: windowless_ = window != static_cast<gfx::PluginWindowHandle>(0);
dunno if it'd be clearer, but you could do
  windowless_ = !!window;

http://codereview.chromium.org/146078/diff/3077/3095
File webkit/glue/plugins/gtk_plugin_container_host.cc (right):

http://codereview.chromium.org/146078/diff/3077/3095#newcode7
Line 7: #include <gtk/gtk.h>
extra newline after system header

http://codereview.chromium.org/146078/diff/3077/3095#newcode15
Line 15: static gboolean AlwaysTrue(void *unused) {
star on left

http://codereview.chromium.org/146078/diff/3077/3095#newcode130
Line 130: gboolean GtkPluginContainerHost::UnrealizeCallback(GtkWidget *widget,
stars on left

http://codereview.chromium.org/146078/diff/3077/3096
File webkit/glue/plugins/gtk_plugin_container_host.h (right):

http://codereview.chromium.org/146078/diff/3077/3096#newcode15
Line 15: // Helper class that creates and manages plugin containers (GtkSocket).
We use the term "host" for the browser-side half of something that exists across
browser/renderer processes.  Can you use another name for this? 
PluginContainerManager would do.

http://codereview.chromium.org/146078/diff/3077/3096#newcode29
Line 29: // Moves a plugin container.
This comment is clear from the name.  Could you add something about "takes an
update from webkit and moves/reshapes(?) the plugin accordingly"

http://codereview.chromium.org/146078/diff/3077/3096#newcode36
Line 36: // Call back for when the plugin container loses its XID, so that it
can be
Callback

http://codereview.chromium.org/146078/diff/3077/3096#newcode38
Line 38: static gboolean UnrealizeCallback(GtkWidget *widget, void *user_data);
stars on the left (GtkWidget* widget, void* user_data)

http://codereview.chromium.org/146078/diff/3077/3096#newcode40
Line 40: // Parent of the plugin containers.
Is this the GtkFixed?  Maybe mention that here?

http://codereview.chromium.org/146078/diff/3077/3098
File webkit/tools/test_shell/test_webview_delegate_gtk.cc (right):

http://codereview.chromium.org/146078/diff/3077/3098#newcode233
Line 233: GtkPluginContainerHost &plugin_container_host =
& on left.  i guess this will be a pointer once you make the ohter change

http://codereview.chromium.org/146078/diff/3077/3099
File webkit/tools/test_shell/webview_host.h (right):

http://codereview.chromium.org/146078/diff/3077/3099#newcode43
Line 43: #if defined(OS_LINUX)
merge this ifdef with the one above it?

if it returns a ref, it should be a const ref, otherwise it should return a
pointer.  const modifier on getters too

http://codereview.chromium.org/146078/diff/3077/3101
File webkit/webkit.gyp (right):

http://codereview.chromium.org/146078/diff/3077/3101#newcode4659
Line 4659: ['exclude', r'gtk_plugin_container_host\.(cc|h)']],
maybe just exclude r'^gtk_'  ?

Powered by Google App Engine
This is Rietveld 408576698