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/frame_tree_node.h" | 5 #include "content/browser/frame_host/frame_tree_node.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/profiler/scoped_tracker.h" | 10 #include "base/profiler/scoped_tracker.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "content/browser/frame_host/frame_tree.h" | 12 #include "content/browser/frame_host/frame_tree.h" |
13 #include "content/browser/frame_host/navigation_request.h" | 13 #include "content/browser/frame_host/navigation_request.h" |
14 #include "content/browser/frame_host/navigator.h" | 14 #include "content/browser/frame_host/navigator.h" |
15 #include "content/browser/frame_host/render_frame_host_impl.h" | 15 #include "content/browser/frame_host/render_frame_host_impl.h" |
16 #include "content/browser/renderer_host/render_view_host_impl.h" | 16 #include "content/browser/renderer_host/render_view_host_impl.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 19 #include "content/public/common/site_isolation_policy.h" |
19 | 20 |
20 namespace content { | 21 namespace content { |
21 | 22 |
22 namespace { | 23 namespace { |
23 | 24 |
24 // This is a global map between frame_tree_node_ids and pointers to | 25 // This is a global map between frame_tree_node_ids and pointers to |
25 // FrameTreeNodes. | 26 // FrameTreeNodes. |
26 typedef base::hash_map<int, FrameTreeNode*> FrameTreeNodeIDMap; | 27 typedef base::hash_map<int, FrameTreeNode*> FrameTreeNodeIDMap; |
27 | 28 |
28 base::LazyInstance<FrameTreeNodeIDMap> g_frame_tree_node_id_map = | 29 base::LazyInstance<FrameTreeNodeIDMap> g_frame_tree_node_id_map = |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 render_manager_.current_host()->GetSiteInstance()->GetBrowserContext(), | 132 render_manager_.current_host()->GetSiteInstance()->GetBrowserContext(), |
132 render_manager_.current_host()->GetSiteInstance(), | 133 render_manager_.current_host()->GetSiteInstance(), |
133 render_manager_.current_host()->GetRoutingID(), | 134 render_manager_.current_host()->GetRoutingID(), |
134 frame_routing_id); | 135 frame_routing_id); |
135 child->set_parent(this); | 136 child->set_parent(this); |
136 | 137 |
137 // Other renderer processes in this BrowsingInstance may need to find out | 138 // Other renderer processes in this BrowsingInstance may need to find out |
138 // about the new frame. Create a proxy for the child frame in all | 139 // about the new frame. Create a proxy for the child frame in all |
139 // SiteInstances that have a proxy for the frame's parent, since all frames | 140 // SiteInstances that have a proxy for the frame's parent, since all frames |
140 // in a frame tree should have the same set of proxies. | 141 // in a frame tree should have the same set of proxies. |
141 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 142 // TODO(alexmos, nick): We ought to do this for non-oopif too, for openers. |
142 switches::kSitePerProcess)) | 143 if (SiteIsolationPolicy::AreCrossProcessFramesPossible()) |
143 render_manager_.CreateProxiesForChildFrame(child.get()); | 144 render_manager_.CreateProxiesForChildFrame(child.get()); |
144 | 145 |
145 children_.push_back(child.release()); | 146 children_.push_back(child.release()); |
146 } | 147 } |
147 | 148 |
148 void FrameTreeNode::RemoveChild(FrameTreeNode* child) { | 149 void FrameTreeNode::RemoveChild(FrameTreeNode* child) { |
149 std::vector<FrameTreeNode*>::iterator iter; | 150 std::vector<FrameTreeNode*>::iterator iter; |
150 for (iter = children_.begin(); iter != children_.end(); ++iter) { | 151 for (iter = children_.begin(); iter != children_.end(); ++iter) { |
151 if ((*iter) == child) | 152 if ((*iter) == child) |
152 break; | 153 break; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 FROM_HERE_WITH_EXPLICIT_FUNCTION( | 350 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
350 "465796 FrameTreeNode::DidStopLoading::End")); | 351 "465796 FrameTreeNode::DidStopLoading::End")); |
351 } | 352 } |
352 | 353 |
353 void FrameTreeNode::DidChangeLoadProgress(double load_progress) { | 354 void FrameTreeNode::DidChangeLoadProgress(double load_progress) { |
354 loading_progress_ = load_progress; | 355 loading_progress_ = load_progress; |
355 frame_tree_->UpdateLoadProgress(); | 356 frame_tree_->UpdateLoadProgress(); |
356 } | 357 } |
357 | 358 |
358 } // namespace content | 359 } // namespace content |
OLD | NEW |