| 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 "base/metrics/user_metrics_action.h" | 9 #include "base/metrics/user_metrics_action.h" |
| 10 #include "content/browser/child_process_security_policy_impl.h" | 10 #include "content/browser/child_process_security_policy_impl.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 g_routing_id_frame_map.Get().erase( | 73 g_routing_id_frame_map.Get().erase( |
| 74 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); | 74 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); |
| 75 if (delegate_) | 75 if (delegate_) |
| 76 delegate_->RenderFrameDeleted(this); | 76 delegate_->RenderFrameDeleted(this); |
| 77 | 77 |
| 78 // Notify the FrameTree that this RFH is going away, allowing it to shut down | 78 // Notify the FrameTree that this RFH is going away, allowing it to shut down |
| 79 // the corresponding RenderViewHost if it is no longer needed. | 79 // the corresponding RenderViewHost if it is no longer needed. |
| 80 frame_tree_->UnregisterRenderFrameHost(this); | 80 frame_tree_->UnregisterRenderFrameHost(this); |
| 81 } | 81 } |
| 82 | 82 |
| 83 int RenderFrameHostImpl::GetRoutingID() { |
| 84 return routing_id_; |
| 85 } |
| 86 |
| 83 SiteInstance* RenderFrameHostImpl::GetSiteInstance() { | 87 SiteInstance* RenderFrameHostImpl::GetSiteInstance() { |
| 84 return render_view_host_->GetSiteInstance(); | 88 return render_view_host_->GetSiteInstance(); |
| 85 } | 89 } |
| 86 | 90 |
| 87 RenderProcessHost* RenderFrameHostImpl::GetProcess() { | 91 RenderProcessHost* RenderFrameHostImpl::GetProcess() { |
| 88 // TODO(nasko): This should return its own process, once we have working | 92 // TODO(nasko): This should return its own process, once we have working |
| 89 // cross-process navigation for subframes. | 93 // cross-process navigation for subframes. |
| 90 return render_view_host_->GetProcess(); | 94 return render_view_host_->GetProcess(); |
| 91 } | 95 } |
| 92 | 96 |
| 93 int RenderFrameHostImpl::GetRoutingID() { | |
| 94 return routing_id_; | |
| 95 } | |
| 96 | |
| 97 RenderFrameHost* RenderFrameHostImpl::GetParent() { | 97 RenderFrameHost* RenderFrameHostImpl::GetParent() { |
| 98 FrameTreeNode* parent_node = frame_tree_node_->parent(); | 98 FrameTreeNode* parent_node = frame_tree_node_->parent(); |
| 99 if (!parent_node) | 99 if (!parent_node) |
| 100 return NULL; | 100 return NULL; |
| 101 return parent_node->current_frame_host(); | 101 return parent_node->current_frame_host(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool RenderFrameHostImpl::IsCrossProcessSubframe() { | 104 bool RenderFrameHostImpl::IsCrossProcessSubframe() { |
| 105 FrameTreeNode* parent_node = frame_tree_node_->parent(); | 105 FrameTreeNode* parent_node = frame_tree_node_->parent(); |
| 106 if (!parent_node) | 106 if (!parent_node) |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // filenames it can't access in a future session restore. | 302 // filenames it can't access in a future session restore. |
| 303 if (!render_view_host_->CanAccessFilesOfPageState( | 303 if (!render_view_host_->CanAccessFilesOfPageState( |
| 304 validated_params.page_state)) { | 304 validated_params.page_state)) { |
| 305 GetProcess()->ReceivedBadMessage(); | 305 GetProcess()->ReceivedBadMessage(); |
| 306 return; | 306 return; |
| 307 } | 307 } |
| 308 | 308 |
| 309 frame_tree_node()->navigator()->DidNavigate(this, validated_params); | 309 frame_tree_node()->navigator()->DidNavigate(this, validated_params); |
| 310 } | 310 } |
| 311 | 311 |
| 312 int RenderFrameHostImpl::GetEnabledBindings() { |
| 313 return render_view_host_->GetEnabledBindings(); |
| 314 } |
| 315 |
| 312 void RenderFrameHostImpl::SwapOut() { | 316 void RenderFrameHostImpl::SwapOut() { |
| 313 if (render_view_host_->IsRenderViewLive()) { | 317 if (render_view_host_->IsRenderViewLive()) { |
| 314 Send(new FrameMsg_SwapOut(routing_id_)); | 318 Send(new FrameMsg_SwapOut(routing_id_)); |
| 315 } else { | 319 } else { |
| 316 // Our RenderViewHost doesn't have a live renderer, so just skip the unload | 320 // Our RenderViewHost doesn't have a live renderer, so just skip the unload |
| 317 // event. | 321 // event. |
| 318 OnSwappedOut(true); | 322 OnSwappedOut(true); |
| 319 } | 323 } |
| 320 } | 324 } |
| 321 | 325 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 params.pending_history_list_offset = -1; | 423 params.pending_history_list_offset = -1; |
| 420 params.current_history_list_offset = -1; | 424 params.current_history_list_offset = -1; |
| 421 params.current_history_list_length = 0; | 425 params.current_history_list_length = 0; |
| 422 params.url = url; | 426 params.url = url; |
| 423 params.transition = PAGE_TRANSITION_LINK; | 427 params.transition = PAGE_TRANSITION_LINK; |
| 424 params.navigation_type = FrameMsg_Navigate_Type::NORMAL; | 428 params.navigation_type = FrameMsg_Navigate_Type::NORMAL; |
| 425 Navigate(params); | 429 Navigate(params); |
| 426 } | 430 } |
| 427 | 431 |
| 428 } // namespace content | 432 } // namespace content |
| OLD | NEW |