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

Issue 10829225: Browser Plugin: Add HTML5-like postMessage support (Closed)

Created:
8 years, 4 months ago by Fady Samuel
Modified:
8 years, 2 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, rjkroege, lazyboy
Visibility:
Public.

Description

Browser Plugin: Add HTML5-like postMessage support This is an implementation of HTML5-like postMessage support for the browser plugin. It works as follows: In BrowserPluginEmbedder:NavigateGuest, the browser process creates two swapped out RenderView: A swapped out RenderView for the guest in the embedder render process and a swapped out RenderView for the embedder in the guest render process. The guest RenderView in the embedder process can be accessed via browserPlugin.contentWindow or through the MessageEvent object received from the guest, event.source. The embedder RenderView in the guest process can be accessed through the MessageEvent object on message events, event.source. BrowserPluginEmbedderHelper, and BrowserPluginGuestHelper intercept ViewHostMsg_RouteMessageEvent messages from the swapped out RenderViews and route them appropriately. Note: BrowserPluginBindings now registers add/removeCustomEventListener instead of add/removeEventListener so that the default WebKit implementations are not shadowed by the custom implementations to allow for WebKit MessageEvents to be registered. BUG=141238 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=162353 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=162487 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=162631

Patch Set 1 #

Patch Set 2 : Fixed PostMessage #

Total comments: 8

Patch Set 3 : Rewrite #

Patch Set 4 : Fixed crash + cleanup #

Total comments: 34

Patch Set 5 : Merged with ToT + Addressed comments #

Patch Set 6 : Fixed targetOrigin, and added comments about frame_id #

Patch Set 7 : Implement browserPlugin.contentWindow: Experiencing a v8 bug that needs to be fixed #

Patch Set 8 : Fixed race condition #

Patch Set 9 : Guests now do top-level navigations #

Patch Set 10 : Merge with ToT #

Patch Set 11 : Merge with ToT. Added subframe targeting + test. #

Total comments: 21

Patch Set 12 : Addressed Nasko's comments #

Patch Set 13 : Merged with ToT. Disabled iframe targeting test. #

Patch Set 14 : Verified to work with nasko@'s disabled frame tree updates #

Total comments: 12

Patch Set 15 : Reworked PostMessage #

Patch Set 16 : No need to rename addEventListener/removeEventListener #

Total comments: 22

Patch Set 17 : Merged with ToT. Addressed creis@'s comments #

Total comments: 6

Patch Set 18 : Fixed nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+235 lines, -8 lines) Patch
M content/browser/browser_plugin/browser_plugin_embedder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +9 lines, -2 lines 0 comments Download
M content/browser/browser_plugin/browser_plugin_host_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +89 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +23 lines, -4 lines 0 comments Download
M content/common/browser_plugin_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +7 lines, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +17 lines, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_bindings.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +15 lines, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/browser_plugin/browser_plugin_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +9 lines, -0 lines 0 comments Download
M content/test/data/browser_plugin_embedder.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +30 lines, -2 lines 0 comments Download
A content/test/data/browser_plugin_post_message_guest.html View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +23 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
Fady Samuel
8 years, 4 months ago (2012-08-08 18:22:08 UTC) #1
Charlie Reis
Thanks, but I've found this kind of hard to follow, since it's not obvious which ...
8 years, 4 months ago (2012-08-10 01:32:52 UTC) #2
Fady Samuel
On 2012/08/10 01:32:52, creis wrote: > Thanks, but I've found this kind of hard to ...
8 years, 3 months ago (2012-09-13 19:12:21 UTC) #3
Fady Samuel
Hi Nasko, Could you please take a look at this? I put a detailed description ...
8 years, 3 months ago (2012-09-18 19:15:00 UTC) #4
Fady Samuel
Sorry, I meant the details are in the issue description. Fady On Tue, Sep 18, ...
8 years, 3 months ago (2012-09-18 19:16:24 UTC) #5
nasko
I did an initial round of reviewing the code. Kudos for the great description! It ...
8 years, 3 months ago (2012-09-19 21:19:59 UTC) #6
Fady Samuel
Hi Nasko, I've more or less addressed all your comments except the real frame ID ...
8 years, 3 months ago (2012-09-20 15:24:27 UTC) #7
Fady Samuel
Hi Nasko, I've fixed the last of the issues you raised. Thanks, Fady
8 years, 3 months ago (2012-09-20 16:57:18 UTC) #8
Fady Samuel
Hi Nasko, I've fixed the last of the issues you raised. Thanks, Fady
8 years, 3 months ago (2012-09-20 16:57:18 UTC) #9
Fady Samuel
browserPlugin.contentWindow mostly works. There's a v8 issue that still needs to be fixed to allow ...
8 years, 2 months ago (2012-09-28 22:45:42 UTC) #10
Fady Samuel
Added subframe targeting. PTAL.
8 years, 2 months ago (2012-10-02 16:40:05 UTC) #11
nasko
Great progress! http://codereview.chromium.org/10829225/diff/57052/content/browser/browser_plugin/browser_plugin_embedder.cc File content/browser/browser_plugin/browser_plugin_embedder.cc (right): http://codereview.chromium.org/10829225/diff/57052/content/browser/browser_plugin/browser_plugin_embedder.cc#newcode138 content/browser/browser_plugin/browser_plugin_embedder.cc:138: // Prepare the swapped out RenderView for ...
8 years, 2 months ago (2012-10-02 17:52:31 UTC) #12
Fady Samuel
https://codereview.chromium.org/10829225/diff/57052/content/browser/browser_plugin/browser_plugin_embedder.cc File content/browser/browser_plugin/browser_plugin_embedder.cc (right): https://codereview.chromium.org/10829225/diff/57052/content/browser/browser_plugin/browser_plugin_embedder.cc#newcode138 content/browser/browser_plugin/browser_plugin_embedder.cc:138: // Prepare the swapped out RenderView for the guest ...
8 years, 2 months ago (2012-10-02 22:04:08 UTC) #13
Fady Samuel
8 years, 2 months ago (2012-10-04 16:48:55 UTC) #14
Fady Samuel
Hi Charlie, Once Nasko's patch to disable frame tree updates lands, this should be go ...
8 years, 2 months ago (2012-10-04 19:46:42 UTC) #15
Charlie Reis
Maybe I'm misunderstanding, but I think you're doing much more work than you need to ...
8 years, 2 months ago (2012-10-04 21:58:24 UTC) #16
Fady Samuel
https://codereview.chromium.org/10829225/diff/77001/content/browser/browser_plugin/browser_plugin_embedder.cc File content/browser/browser_plugin/browser_plugin_embedder.cc (left): https://codereview.chromium.org/10829225/diff/77001/content/browser/browser_plugin/browser_plugin_embedder.cc#oldcode244 content/browser/browser_plugin/browser_plugin_embedder.cc:244: DestroyGuests(); On 2012/10/04 21:58:25, creis wrote: > How is ...
8 years, 2 months ago (2012-10-10 21:36:07 UTC) #17
Charlie Reis
Awesome. This seems much better to me. https://codereview.chromium.org/10829225/diff/83018/content/browser/browser_plugin/browser_plugin_host_browsertest.cc File content/browser/browser_plugin/browser_plugin_host_browsertest.cc (right): https://codereview.chromium.org/10829225/diff/83018/content/browser/browser_plugin/browser_plugin_host_browsertest.cc#newcode706 content/browser/browser_plugin/browser_plugin_host_browsertest.cc:706: // 1. ...
8 years, 2 months ago (2012-10-12 00:31:43 UTC) #18
Fady Samuel
Charlie, I've addressed your comments. Thanks. Adam, could you please take a look at browser_plugin.cc ...
8 years, 2 months ago (2012-10-12 18:07:53 UTC) #19
Charlie Reis
Great. LGTM, once abarth@ looks over GetContentWindow(). http://codereview.chromium.org/10829225/diff/94002/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): http://codereview.chromium.org/10829225/diff/94002/content/browser/web_contents/web_contents_impl.cc#newcode3039 content/browser/web_contents/web_contents_impl.cc:3039: // opener ...
8 years, 2 months ago (2012-10-15 23:10:09 UTC) #20
abarth-chromium
http://codereview.chromium.org/10829225/diff/94002/content/renderer/browser_plugin/browser_plugin.cc File content/renderer/browser_plugin/browser_plugin.cc (right): http://codereview.chromium.org/10829225/diff/94002/content/renderer/browser_plugin/browser_plugin.cc#newcode146 content/renderer/browser_plugin/browser_plugin.cc:146: NPObject* BrowserPlugin::GetContentWindow() const { This function LGTM
8 years, 2 months ago (2012-10-16 18:47:27 UTC) #21
Fady Samuel
Thanks Charlie, Adam! Committing this now! https://codereview.chromium.org/10829225/diff/94002/content/browser/web_contents/web_contents_impl.cc File content/browser/web_contents/web_contents_impl.cc (right): https://codereview.chromium.org/10829225/diff/94002/content/browser/web_contents/web_contents_impl.cc#newcode3039 content/browser/web_contents/web_contents_impl.cc:3039: // opener chain ...
8 years, 2 months ago (2012-10-16 19:17:08 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/10829225/106001
8 years, 2 months ago (2012-10-16 19:18:20 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/fsamuel@chromium.org/10829225/106001
8 years, 2 months ago (2012-10-17 11:13:14 UTC) #24
commit-bot: I haz the power
8 years, 2 months ago (2012-10-17 12:06:48 UTC) #25
Change committed as 162353

Powered by Google App Engine
This is Rietveld 408576698