Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(305)

Side by Side Diff: content/browser/frame_host/frame_tree_node.cc

Issue 1208143002: Move existing kSitePerProcess checks to a policy-oracle object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@swapped_out_cmdline_checks
Patch Set: Attempt to fix compile. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/frame_messages.h" 17 #include "content/common/frame_messages.h"
18 #include "content/common/site_isolation_policy.h"
18 #include "content/public/browser/browser_thread.h" 19 #include "content/public/browser/browser_thread.h"
19 #include "content/public/common/content_switches.h" 20 #include "content/public/common/content_switches.h"
20 21
21 namespace content { 22 namespace content {
22 23
23 namespace { 24 namespace {
24 25
25 // This is a global map between frame_tree_node_ids and pointers to 26 // This is a global map between frame_tree_node_ids and pointers to
26 // FrameTreeNodes. 27 // FrameTreeNodes.
27 typedef base::hash_map<int, FrameTreeNode*> FrameTreeNodeIDMap; 28 typedef base::hash_map<int, FrameTreeNode*> FrameTreeNodeIDMap;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 render_manager_.current_host()->GetSiteInstance()->GetBrowserContext(), 134 render_manager_.current_host()->GetSiteInstance()->GetBrowserContext(),
134 render_manager_.current_host()->GetSiteInstance(), 135 render_manager_.current_host()->GetSiteInstance(),
135 render_manager_.current_host()->GetRoutingID(), 136 render_manager_.current_host()->GetRoutingID(),
136 frame_routing_id); 137 frame_routing_id);
137 child->set_parent(this); 138 child->set_parent(this);
138 139
139 // Other renderer processes in this BrowsingInstance may need to find out 140 // Other renderer processes in this BrowsingInstance may need to find out
140 // about the new frame. Create a proxy for the child frame in all 141 // about the new frame. Create a proxy for the child frame in all
141 // SiteInstances that have a proxy for the frame's parent, since all frames 142 // SiteInstances that have a proxy for the frame's parent, since all frames
142 // in a frame tree should have the same set of proxies. 143 // in a frame tree should have the same set of proxies.
143 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 144 // TODO(alexmos, nick): We ought to do this for non-oopif too, for openers.
144 switches::kSitePerProcess)) 145 if (SiteIsolationPolicy::AreCrossProcessFramesPossible())
145 render_manager_.CreateProxiesForChildFrame(child.get()); 146 render_manager_.CreateProxiesForChildFrame(child.get());
146 147
147 children_.push_back(child.release()); 148 children_.push_back(child.release());
148 } 149 }
149 150
150 void FrameTreeNode::RemoveChild(FrameTreeNode* child) { 151 void FrameTreeNode::RemoveChild(FrameTreeNode* child) {
151 std::vector<FrameTreeNode*>::iterator iter; 152 std::vector<FrameTreeNode*>::iterator iter;
152 for (iter = children_.begin(); iter != children_.end(); ++iter) { 153 for (iter = children_.begin(); iter != children_.end(); ++iter) {
153 if ((*iter) == child) 154 if ((*iter) == child)
154 break; 155 break;
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 // TODO(nasko): see if child frames should send IPCs in site-per-process 378 // TODO(nasko): see if child frames should send IPCs in site-per-process
378 // mode. 379 // mode.
379 if (!IsMainFrame()) 380 if (!IsMainFrame())
380 return true; 381 return true;
381 382
382 render_manager_.Stop(); 383 render_manager_.Stop();
383 return true; 384 return true;
384 } 385 }
385 386
386 } // namespace content 387 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/frame_tree_browsertest.cc ('k') | content/browser/frame_host/navigation_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698