| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_proxy_host.h" | 5 #include "content/browser/frame_host/render_frame_proxy_host.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "content/browser/frame_host/cross_process_frame_connector.h" | 8 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| 9 #include "content/browser/frame_host/frame_tree.h" | 9 #include "content/browser/frame_host/frame_tree.h" |
| 10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 bool RenderFrameProxyHost::OnMessageReceived(const IPC::Message& msg) { | 108 bool RenderFrameProxyHost::OnMessageReceived(const IPC::Message& msg) { |
| 109 if (cross_process_frame_connector_.get() && | 109 if (cross_process_frame_connector_.get() && |
| 110 cross_process_frame_connector_->OnMessageReceived(msg)) | 110 cross_process_frame_connector_->OnMessageReceived(msg)) |
| 111 return true; | 111 return true; |
| 112 | 112 |
| 113 // TODO(nasko): This can be removed once we don't have a swapped out state on | 113 // TODO(nasko): This can be removed once we don't have a swapped out state on |
| 114 // RenderFrameHosts. See https://crbug.com/357747. | 114 // RenderFrameHosts. See https://crbug.com/357747. |
| 115 if (render_frame_host_.get()) | 115 if (render_frame_host_.get()) |
| 116 return render_frame_host_->OnMessageReceived(msg); | 116 return render_frame_host_->OnMessageReceived(msg); |
| 117 | 117 |
| 118 return false; | 118 bool handled = true; |
| 119 IPC_BEGIN_MESSAGE_MAP(RenderFrameProxyHost, msg) |
| 120 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) |
| 121 IPC_MESSAGE_UNHANDLED(handled = false) |
| 122 IPC_END_MESSAGE_MAP() |
| 123 return handled; |
| 119 } | 124 } |
| 120 | 125 |
| 121 bool RenderFrameProxyHost::InitRenderFrameProxy() { | 126 bool RenderFrameProxyHost::InitRenderFrameProxy() { |
| 122 // The process may (if we're sharing a process with another host that already | 127 // The process may (if we're sharing a process with another host that already |
| 123 // initialized it) or may not (we have our own process or the old process | 128 // initialized it) or may not (we have our own process or the old process |
| 124 // crashed) have been initialized. Calling Init multiple times will be | 129 // crashed) have been initialized. Calling Init multiple times will be |
| 125 // ignored, so this is safe. | 130 // ignored, so this is safe. |
| 126 if (!site_instance_->GetProcess()->Init()) | 131 if (!site_instance_->GetProcess()->Init()) |
| 127 return false; | 132 return false; |
| 128 | 133 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 142 ->GetRenderViewHost(site_instance_.get()) | 147 ->GetRenderViewHost(site_instance_.get()) |
| 143 ->GetRoutingID())); | 148 ->GetRoutingID())); |
| 144 | 149 |
| 145 return true; | 150 return true; |
| 146 } | 151 } |
| 147 | 152 |
| 148 void RenderFrameProxyHost::DisownOpener() { | 153 void RenderFrameProxyHost::DisownOpener() { |
| 149 Send(new FrameMsg_DisownOpener(GetRoutingID())); | 154 Send(new FrameMsg_DisownOpener(GetRoutingID())); |
| 150 } | 155 } |
| 151 | 156 |
| 157 void RenderFrameProxyHost::OnOpenURL( |
| 158 const FrameHostMsg_OpenURL_Params& params) { |
| 159 frame_tree_node_->current_frame_host()->OpenURL(params); |
| 160 } |
| 161 |
| 152 } // namespace content | 162 } // namespace content |
| OLD | NEW |