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

Issue 921473006: GuestView: Fix message routing across embedder navigations (Closed)

Created:
5 years, 10 months ago by Fady Samuel
Modified:
5 years, 10 months ago
Reviewers:
kenrb, Charlie Reis, lazyboy
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, extensions-reviews_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, chromium-apps-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

GuestViewManager mapped <owner WebContents, element instance ID> => guest instance ID on attachment. This routed IPCs from a given BrowserPlugin to the appropriate guest. Element instance IDs are unique per process. This mapping is fine in Chrome Apps where the embedder doesn't navigate but not for when the embedder is capable of cross-process navigation. In that case, element instance IDs of two BrowserPlugins in two different embedder processes of the same WebContents have the same key, and would thus route to the same guest. This is an issue because the lifetime of the exiting document overlaps with the lifetime of the entering document. Thus, racy behavior can occur. In particular, when navigating from one PDF to another, IPCs for tear down destined for the exiting BrowserPlugin can occasionally get routed to the entering BrowserPlugin. In bug 436339's case, the first step of tear down is to hide the guest content. That IPC ends up going to the entering guest, and so the new PDF is not displayed on screen. This CL fixes the issue by using <embedder process id, element instance ID> as the key to map to a guest instead of the embedder WebContents as the first component. BUG=436339 Committed: https://crrev.com/833ee7ced817effed9202b9cfddf85b067cf0edf Cr-Commit-Position: refs/heads/master@{#316328}

Patch Set 1 #

Patch Set 2 : More cleanup #

Patch Set 3 : Cleanup #

Patch Set 4 : More cleanup #

Total comments: 2

Patch Set 5 : Addressed nit #

Total comments: 4

Patch Set 6 : Addressed comments #

Patch Set 7 : Fixed PDF nav #

Patch Set 8 : Remove render_view_routing_id() from GuestViewContainer #

Total comments: 8

Patch Set 9 : Addressed comments #

Total comments: 4

Patch Set 10 : Updated comments CQ'ing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -111 lines) Patch
M content/browser/browser_plugin/browser_plugin_embedder.h View 1 2 3 4 5 6 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/browser_plugin/browser_plugin_embedder.cc View 1 2 3 4 5 6 7 8 9 2 chunks +14 lines, -2 lines 0 comments Download
M content/browser/browser_plugin/browser_plugin_message_filter.cc View 1 1 chunk +5 lines, -7 lines 0 comments Download
M content/browser/frame_host/frame_accessibility.cc View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_delegate.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M content/browser/frame_host/render_frame_host_delegate.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 2 chunks +3 lines, -1 line 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 4 chunks +10 lines, -4 lines 0 comments Download
M content/public/browser/browser_plugin_guest_manager.h View 1 1 chunk +2 lines, -3 lines 0 comments Download
M content/public/browser/browser_plugin_guest_manager.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M extensions/browser/guest_view/guest_view_base.cc View 1 1 chunk +1 line, -2 lines 0 comments Download
M extensions/browser/guest_view/guest_view_manager.h View 1 2 3 4 3 chunks +11 lines, -25 lines 0 comments Download
M extensions/browser/guest_view/guest_view_manager.cc View 1 2 3 4 6 chunks +52 lines, -52 lines 0 comments Download
M extensions/browser/guest_view/guest_view_message_filter.h View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M extensions/browser/guest_view/guest_view_message_filter.cc View 1 2 3 3 chunks +0 lines, -3 lines 0 comments Download
M extensions/common/guest_view/OWNERS View 1 2 3 4 5 1 chunk +13 lines, -0 lines 0 comments Download
M extensions/common/guest_view/guest_view_messages.h View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M extensions/renderer/guest_view/extensions_guest_view_container.cc View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M extensions/renderer/guest_view/guest_view_container.h View 1 2 3 4 5 6 7 2 chunks +0 lines, -2 lines 0 comments Download
M extensions/renderer/guest_view/guest_view_container.cc View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 21 (5 generated)
Fady Samuel
5 years, 10 months ago (2015-02-12 02:58:00 UTC) #2
Fady Samuel
+kenrb@ for guest_view_messages.h +creis@ for browser_plugin_guest_manager.* change
5 years, 10 months ago (2015-02-12 14:06:55 UTC) #4
Fady Samuel
On 2015/02/12 14:06:55, Fady Samuel wrote: > +kenrb@ for guest_view_messages.h > +creis@ for browser_plugin_guest_manager.* change ...
5 years, 10 months ago (2015-02-12 14:08:07 UTC) #5
kenrb
lgtm for guest_view_messages.h. As an aside, since you have IPC message definitions in that file, ...
5 years, 10 months ago (2015-02-12 15:50:11 UTC) #6
lazyboy
lgtm with one comment. https://codereview.chromium.org/921473006/diff/60001/extensions/browser/guest_view/guest_view_manager.h File extensions/browser/guest_view/guest_view_manager.h (right): https://codereview.chromium.org/921473006/diff/60001/extensions/browser/guest_view/guest_view_manager.h#newcode134 extensions/browser/guest_view/guest_view_manager.h:134: : embedder_process_id(0), 0 should really ...
5 years, 10 months ago (2015-02-12 17:41:32 UTC) #7
Fady Samuel
Addressed nit Charlie, could you please take a look at: browser_plugin_guest_manager.* web_contents_impl.cc Thanks! https://codereview.chromium.org/921473006/diff/60001/extensions/browser/guest_view/guest_view_manager.h File ...
5 years, 10 months ago (2015-02-12 19:00:54 UTC) #9
Fady Samuel
Addressed nit Charlie, could you please take a look at: browser_plugin_guest_manager.* web_contents_impl.cc Thanks!
5 years, 10 months ago (2015-02-12 19:00:56 UTC) #10
Charlie Reis
Yes, I fully support the change in key for this. This matters not just for ...
5 years, 10 months ago (2015-02-12 21:38:06 UTC) #11
Fady Samuel
Addressed comments. Added OWNERs for messages in extensions/common/guest_view. PTAL Charlie. https://codereview.chromium.org/921473006/diff/80001/content/browser/browser_plugin/browser_plugin_embedder.cc File content/browser/browser_plugin/browser_plugin_embedder.cc (right): https://codereview.chromium.org/921473006/diff/80001/content/browser/browser_plugin/browser_plugin_embedder.cc#newcode142 ...
5 years, 10 months ago (2015-02-13 01:22:13 UTC) #12
Charlie Reis
Thanks for the updates. It looks like there may be a prerequisite of routing the ...
5 years, 10 months ago (2015-02-13 21:21:56 UTC) #13
Fady Samuel
PTAL Charlie. https://codereview.chromium.org/921473006/diff/140001/content/browser/browser_plugin/browser_plugin_embedder.cc File content/browser/browser_plugin/browser_plugin_embedder.cc (right): https://codereview.chromium.org/921473006/diff/140001/content/browser/browser_plugin/browser_plugin_embedder.cc#newcode148 content/browser/browser_plugin/browser_plugin_embedder.cc:148: int owner_process_id = render_frame_host ? On 2015/02/13 ...
5 years, 10 months ago (2015-02-13 22:31:25 UTC) #14
Charlie Reis
Thanks, LGTM with nits. https://codereview.chromium.org/921473006/diff/160001/content/browser/browser_plugin/browser_plugin_embedder.cc File content/browser/browser_plugin/browser_plugin_embedder.cc (right): https://codereview.chromium.org/921473006/diff/160001/content/browser/browser_plugin/browser_plugin_embedder.cc#newcode150 content/browser/browser_plugin/browser_plugin_embedder.cc:150: // routing ID. nit: Please ...
5 years, 10 months ago (2015-02-13 22:36:14 UTC) #15
Fady Samuel
CQ'ing. https://codereview.chromium.org/921473006/diff/160001/content/browser/browser_plugin/browser_plugin_embedder.cc File content/browser/browser_plugin/browser_plugin_embedder.cc (right): https://codereview.chromium.org/921473006/diff/160001/content/browser/browser_plugin/browser_plugin_embedder.cc#newcode150 content/browser/browser_plugin/browser_plugin_embedder.cc:150: // routing ID. On 2015/02/13 22:36:14, Charlie Reis ...
5 years, 10 months ago (2015-02-13 22:47:09 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/921473006/180001
5 years, 10 months ago (2015-02-13 22:48:54 UTC) #19
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 10 months ago (2015-02-13 23:41:01 UTC) #20
commit-bot: I haz the power
5 years, 10 months ago (2015-02-13 23:41:45 UTC) #21
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/833ee7ced817effed9202b9cfddf85b067cf0edf
Cr-Commit-Position: refs/heads/master@{#316328}

Powered by Google App Engine
This is Rietveld 408576698