OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/messaging/extension_message_port.h" | 5 #include "chrome/browser/extensions/api/messaging/extension_message_port.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/scoped_observer.h" | 8 #include "base/scoped_observer.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "content/public/browser/interstitial_page.h" | 10 #include "content/public/browser/interstitial_page.h" |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 if (extension_process_) { | 297 if (extension_process_) { |
298 // All extension frames reside in the same process, so we can just send a | 298 // All extension frames reside in the same process, so we can just send a |
299 // single IPC message to the extension process as an optimization. | 299 // single IPC message to the extension process as an optimization. |
300 // The frame tracking is then only used to make sure that the port gets | 300 // The frame tracking is then only used to make sure that the port gets |
301 // closed when all frames have closed / reloaded. | 301 // closed when all frames have closed / reloaded. |
302 msg->set_routing_id(MSG_ROUTING_CONTROL); | 302 msg->set_routing_id(MSG_ROUTING_CONTROL); |
303 extension_process_->Send(msg.release()); | 303 extension_process_->Send(msg.release()); |
304 return; | 304 return; |
305 } | 305 } |
306 for (content::RenderFrameHost* rfh : frames_) { | 306 for (content::RenderFrameHost* rfh : frames_) { |
307 IPC::Message* msg_copy = new IPC::Message(*msg.get()); | 307 IPC::Message* msg_copy = new IPC::Message(*msg); |
308 msg_copy->set_routing_id(rfh->GetRoutingID()); | 308 msg_copy->set_routing_id(rfh->GetRoutingID()); |
309 rfh->Send(msg_copy); | 309 rfh->Send(msg_copy); |
310 } | 310 } |
311 } | 311 } |
312 | 312 |
313 } // namespace extensions | 313 } // namespace extensions |
OLD | NEW |