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_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "content/browser/frame_host/cross_process_frame_connector.h" | 9 #include "content/browser/frame_host/cross_process_frame_connector.h" |
10 #include "content/browser/frame_host/frame_tree.h" | 10 #include "content/browser/frame_host/frame_tree.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) { | 108 bool RenderFrameHostImpl::OnMessageReceived(const IPC::Message &msg) { |
109 if (delegate_->OnMessageReceived(this, msg)) | 109 if (delegate_->OnMessageReceived(this, msg)) |
110 return true; | 110 return true; |
111 | 111 |
112 bool handled = true; | 112 bool handled = true; |
113 bool msg_is_ok = true; | 113 bool msg_is_ok = true; |
114 IPC_BEGIN_MESSAGE_MAP_EX(RenderFrameHostImpl, msg, msg_is_ok) | 114 IPC_BEGIN_MESSAGE_MAP_EX(RenderFrameHostImpl, msg, msg_is_ok) |
115 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) | 115 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) |
116 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame, | 116 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoadForFrame, |
117 OnDidStartProvisionalLoadForFrame) | 117 OnDidStartProvisionalLoadForFrame) |
| 118 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, |
| 119 OnDidFailProvisionalLoadWithError) |
118 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) | 120 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) |
119 IPC_END_MESSAGE_MAP_EX() | 121 IPC_END_MESSAGE_MAP_EX() |
120 | 122 |
121 if (!msg_is_ok) { | 123 if (!msg_is_ok) { |
122 // The message had a handler, but its de-serialization failed. | 124 // The message had a handler, but its de-serialization failed. |
123 // Kill the renderer. | 125 // Kill the renderer. |
124 RecordAction(UserMetricsAction("BadMessageTerminate_RFH")); | 126 RecordAction(UserMetricsAction("BadMessageTerminate_RFH")); |
125 GetProcess()->ReceivedBadMessage(); | 127 GetProcess()->ReceivedBadMessage(); |
126 } | 128 } |
127 | 129 |
(...skipping 20 matching lines...) Expand all Loading... |
148 | 150 |
149 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame( | 151 void RenderFrameHostImpl::OnDidStartProvisionalLoadForFrame( |
150 int64 frame_id, | 152 int64 frame_id, |
151 int64 parent_frame_id, | 153 int64 parent_frame_id, |
152 bool is_main_frame, | 154 bool is_main_frame, |
153 const GURL& url) { | 155 const GURL& url) { |
154 frame_tree_node_->navigator()->DidStartProvisionalLoad( | 156 frame_tree_node_->navigator()->DidStartProvisionalLoad( |
155 this, frame_id, parent_frame_id, is_main_frame, url); | 157 this, frame_id, parent_frame_id, is_main_frame, url); |
156 } | 158 } |
157 | 159 |
| 160 void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( |
| 161 const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { |
| 162 frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); |
| 163 } |
| 164 |
158 void RenderFrameHostImpl::SwapOut() { | 165 void RenderFrameHostImpl::SwapOut() { |
159 if (render_view_host_->IsRenderViewLive()) { | 166 if (render_view_host_->IsRenderViewLive()) { |
160 Send(new FrameMsg_SwapOut(routing_id())); | 167 Send(new FrameMsg_SwapOut(routing_id())); |
161 } else { | 168 } else { |
162 // Our RenderViewHost doesn't have a live renderer, so just skip the unload | 169 // Our RenderViewHost doesn't have a live renderer, so just skip the unload |
163 // event. | 170 // event. |
164 OnSwappedOut(true); | 171 OnSwappedOut(true); |
165 } | 172 } |
166 } | 173 } |
167 | 174 |
168 void RenderFrameHostImpl::OnSwapOutACK() { | 175 void RenderFrameHostImpl::OnSwapOutACK() { |
169 OnSwappedOut(false); | 176 OnSwappedOut(false); |
170 } | 177 } |
171 | 178 |
172 void RenderFrameHostImpl::OnSwappedOut(bool timed_out) { | 179 void RenderFrameHostImpl::OnSwappedOut(bool timed_out) { |
173 frame_tree_node_->render_manager()->SwappedOutFrame(this); | 180 frame_tree_node_->render_manager()->SwappedOutFrame(this); |
174 } | 181 } |
175 | 182 |
176 } // namespace content | 183 } // namespace content |
OLD | NEW |