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

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 1949163002: SendPageMessage() should not send to a WebView guest's embedder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revise to use site instances. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/apps/guest_view/web_view_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 58c17d54c34798e0e070878e4e572a594f41a3a3..53960255214d64aad57311978a24e018325ff317 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2503,8 +2503,16 @@ void RenderFrameHostManager::SendPageMessage(IPC::Message* msg) {
sender->Send(copy);
};
- for (const auto& pair : proxy_hosts_)
- send_msg(pair.second.get(), pair.second->GetRoutingID(), msg);
+ // When sending a PageMessage for an inner WebContents, we don't want to also
+ // send it to the outer WebContent's frames as well.
+ SiteInstance* outer_delegate_site_instance =
+ ForInnerDelegate()
+ ? GetOuterDelegateNode()->current_frame_host()->GetSiteInstance()
lfg 2016/05/05 17:27:11 I think we probably want to look at the SiteInstan
wjmaclean 2016/05/05 17:39:07 Done. We're sure that parent() is always non-null
wjmaclean 2016/05/05 18:53:49 Just curious: as a casual reader of this code, did
lfg 2016/05/05 19:00:59 +lazyboy The RFH is owned by the RFHM, which come
+ : nullptr;
+ for (const auto& pair : proxy_hosts_) {
+ if (outer_delegate_site_instance != pair.second->GetSiteInstance())
+ send_msg(pair.second.get(), pair.second->GetRoutingID(), msg);
+ }
if (speculative_render_frame_host_) {
send_msg(speculative_render_frame_host_.get(),
« no previous file with comments | « chrome/browser/apps/guest_view/web_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698