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

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 comment. 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..4bad0637251136b0ac365578dee2fa2a11daab92 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -2503,8 +2503,14 @@ 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 frame as well.
+ RenderFrameProxyHost* outer_delegate_proxy =
+ ForInnerDelegate() ? GetProxyToOuterDelegate() : nullptr;
+ for (const auto& pair : proxy_hosts_) {
+ if (outer_delegate_proxy != pair.second.get())
+ 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