Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 for an inner WebContents, we don't want to also |
| 2507 send_msg(pair.second.get(), pair.second->GetRoutingID(), msg); | 2507 // send it to the outer WebContent's frames as well. |
| 2508 SiteInstance* outer_delegate_site_instance = | |
| 2509 ForInnerDelegate() | |
| 2510 ? 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
| |
| 2511 : nullptr; | |
| 2512 for (const auto& pair : proxy_hosts_) { | |
| 2513 if (outer_delegate_site_instance != pair.second->GetSiteInstance()) | |
| 2514 send_msg(pair.second.get(), pair.second->GetRoutingID(), msg); | |
| 2515 } | |
| 2508 | 2516 |
| 2509 if (speculative_render_frame_host_) { | 2517 if (speculative_render_frame_host_) { |
| 2510 send_msg(speculative_render_frame_host_.get(), | 2518 send_msg(speculative_render_frame_host_.get(), |
| 2511 speculative_render_frame_host_->GetRoutingID(), msg); | 2519 speculative_render_frame_host_->GetRoutingID(), msg); |
| 2512 } else if (pending_render_frame_host_) { | 2520 } else if (pending_render_frame_host_) { |
| 2513 send_msg(pending_render_frame_host_.get(), | 2521 send_msg(pending_render_frame_host_.get(), |
| 2514 pending_render_frame_host_->GetRoutingID(), msg); | 2522 pending_render_frame_host_->GetRoutingID(), msg); |
| 2515 } | 2523 } |
| 2516 | 2524 |
| 2517 msg->set_routing_id(render_frame_host_->GetRoutingID()); | 2525 msg->set_routing_id(render_frame_host_->GetRoutingID()); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 2547 resolved_url)) { | 2555 resolved_url)) { |
| 2548 DCHECK(!dest_instance || | 2556 DCHECK(!dest_instance || |
| 2549 dest_instance == render_frame_host_->GetSiteInstance()); | 2557 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2550 return false; | 2558 return false; |
| 2551 } | 2559 } |
| 2552 | 2560 |
| 2553 return true; | 2561 return true; |
| 2554 } | 2562 } |
| 2555 | 2563 |
| 2556 } // namespace content | 2564 } // namespace content |
| OLD | NEW |