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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after
2496 delete msg; 2496 delete msg;
2497 return; 2497 return;
2498 } 2498 }
2499 2499
2500 auto send_msg = [](IPC::Sender* sender, int routing_id, IPC::Message* msg) { 2500 auto send_msg = [](IPC::Sender* sender, int routing_id, IPC::Message* msg) {
2501 IPC::Message* copy = new IPC::Message(*msg); 2501 IPC::Message* copy = new IPC::Message(*msg);
2502 copy->set_routing_id(routing_id); 2502 copy->set_routing_id(routing_id);
2503 sender->Send(copy); 2503 sender->Send(copy);
2504 }; 2504 };
2505 2505
2506 for (const auto& pair : proxy_hosts_) 2506 // When sending a PageMessage to a WebView's guest, we don't want to also
nasko 2016/05/04 21:58:59 nit: WebView is overloaded term, let's avoid using
wjmaclean 2016/05/05 15:40:56 Done.
2507 send_msg(pair.second.get(), pair.second->GetRoutingID(), msg); 2507 // send it to the embedder's frames as well. A WebView guest frame tree should
2508 // have no proxies other than for its embedder.
2509 if (!ForInnerDelegate()) {
nasko 2016/05/04 21:58:59 This will not be true if we allow cross-process na
wjmaclean 2016/05/05 15:40:56 I'm not sure I understand this. What if some sub-f
2510 for (const auto& pair : proxy_hosts_)
2511 send_msg(pair.second.get(), pair.second->GetRoutingID(), msg);
2512 }
2508 2513
2509 if (speculative_render_frame_host_) { 2514 if (speculative_render_frame_host_) {
2510 send_msg(speculative_render_frame_host_.get(), 2515 send_msg(speculative_render_frame_host_.get(),
2511 speculative_render_frame_host_->GetRoutingID(), msg); 2516 speculative_render_frame_host_->GetRoutingID(), msg);
2512 } else if (pending_render_frame_host_) { 2517 } else if (pending_render_frame_host_) {
2513 send_msg(pending_render_frame_host_.get(), 2518 send_msg(pending_render_frame_host_.get(),
2514 pending_render_frame_host_->GetRoutingID(), msg); 2519 pending_render_frame_host_->GetRoutingID(), msg);
2515 } 2520 }
2516 2521
2517 msg->set_routing_id(render_frame_host_->GetRoutingID()); 2522 msg->set_routing_id(render_frame_host_->GetRoutingID());
(...skipping 29 matching lines...) Expand all
2547 resolved_url)) { 2552 resolved_url)) {
2548 DCHECK(!dest_instance || 2553 DCHECK(!dest_instance ||
2549 dest_instance == render_frame_host_->GetSiteInstance()); 2554 dest_instance == render_frame_host_->GetSiteInstance());
2550 return false; 2555 return false;
2551 } 2556 }
2552 2557
2553 return true; 2558 return true;
2554 } 2559 }
2555 2560
2556 } // namespace content 2561 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698