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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.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: Partial fixes to Nasko's comments. Created 5 years, 5 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/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "content/public/browser/content_browser_client.h" 55 #include "content/public/browser/content_browser_client.h"
56 #include "content/public/browser/permission_manager.h" 56 #include "content/public/browser/permission_manager.h"
57 #include "content/public/browser/permission_type.h" 57 #include "content/public/browser/permission_type.h"
58 #include "content/public/browser/render_process_host.h" 58 #include "content/public/browser/render_process_host.h"
59 #include "content/public/browser/render_widget_host_view.h" 59 #include "content/public/browser/render_widget_host_view.h"
60 #include "content/public/browser/stream_handle.h" 60 #include "content/public/browser/stream_handle.h"
61 #include "content/public/browser/user_metrics.h" 61 #include "content/public/browser/user_metrics.h"
62 #include "content/public/common/content_constants.h" 62 #include "content/public/common/content_constants.h"
63 #include "content/public/common/content_switches.h" 63 #include "content/public/common/content_switches.h"
64 #include "content/public/common/isolated_world_ids.h" 64 #include "content/public/common/isolated_world_ids.h"
65 #include "content/public/common/site_isolation_policy.h"
65 #include "content/public/common/url_constants.h" 66 #include "content/public/common/url_constants.h"
66 #include "content/public/common/url_utils.h" 67 #include "content/public/common/url_utils.h"
67 #include "ui/accessibility/ax_tree.h" 68 #include "ui/accessibility/ax_tree.h"
68 #include "ui/accessibility/ax_tree_update.h" 69 #include "ui/accessibility/ax_tree_update.h"
69 #include "url/gurl.h" 70 #include "url/gurl.h"
70 71
71 #if defined(OS_ANDROID) 72 #if defined(OS_ANDROID)
72 #include "content/browser/mojo/service_registrar_android.h" 73 #include "content/browser/mojo/service_registrar_android.h"
73 #endif 74 #endif
74 75
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after
1310 const CommonNavigationParams& common_params, 1311 const CommonNavigationParams& common_params,
1311 const BeginNavigationParams& begin_params, 1312 const BeginNavigationParams& begin_params,
1312 scoped_refptr<ResourceRequestBody> body) { 1313 scoped_refptr<ResourceRequestBody> body) {
1313 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 1314 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
1314 switches::kEnableBrowserSideNavigation)); 1315 switches::kEnableBrowserSideNavigation));
1315 frame_tree_node()->navigator()->OnBeginNavigation( 1316 frame_tree_node()->navigator()->OnBeginNavigation(
1316 frame_tree_node(), common_params, begin_params, body); 1317 frame_tree_node(), common_params, begin_params, body);
1317 } 1318 }
1318 1319
1319 void RenderFrameHostImpl::OnDispatchLoad() { 1320 void RenderFrameHostImpl::OnDispatchLoad() {
1320 CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( 1321 CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible());
1321 switches::kSitePerProcess));
1322 // Only frames with an out-of-process parent frame should be sending this 1322 // Only frames with an out-of-process parent frame should be sending this
1323 // message. 1323 // message.
1324 RenderFrameProxyHost* proxy = 1324 RenderFrameProxyHost* proxy =
1325 frame_tree_node()->render_manager()->GetProxyToParent(); 1325 frame_tree_node()->render_manager()->GetProxyToParent();
1326 if (!proxy) { 1326 if (!proxy) {
1327 bad_message::ReceivedBadMessage(GetProcess(), 1327 bad_message::ReceivedBadMessage(GetProcess(),
1328 bad_message::RFH_NO_PROXY_TO_PARENT); 1328 bad_message::RFH_NO_PROXY_TO_PARENT);
1329 return; 1329 return;
1330 } 1330 }
1331 1331
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
2110 // We may be returning to an existing NavigationEntry that had been granted 2110 // We may be returning to an existing NavigationEntry that had been granted
2111 // file access. If this is a different process, we will need to grant the 2111 // file access. If this is a different process, we will need to grant the
2112 // access again. The files listed in the page state are validated when they 2112 // access again. The files listed in the page state are validated when they
2113 // are received from the renderer to prevent abuse. 2113 // are received from the renderer to prevent abuse.
2114 if (request_params.page_state.IsValid()) { 2114 if (request_params.page_state.IsValid()) {
2115 render_view_host_->GrantFileAccessFromPageState(request_params.page_state); 2115 render_view_host_->GrantFileAccessFromPageState(request_params.page_state);
2116 } 2116 }
2117 } 2117 }
2118 2118
2119 } // namespace content 2119 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698