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

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

Issue 2650473002: Don't swap processes for chrome:// subframes. (Closed)
Patch Set: Fix check correctness and add a test. Created 3 years, 11 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_manager.h" 5 #include "content/browser/frame_host/render_frame_host_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1313 // 1313 //
1314 // NOTE: This can be removed once we have a way to transition between 1314 // NOTE: This can be removed once we have a way to transition between
1315 // RenderViews in response to a link click. 1315 // RenderViews in response to a link click.
1316 // 1316 //
1317 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 1317 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
1318 switches::kProcessPerSite) && 1318 switches::kProcessPerSite) &&
1319 ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_GENERATED)) { 1319 ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_GENERATED)) {
1320 return SiteInstanceDescriptor(current_instance_impl); 1320 return SiteInstanceDescriptor(current_instance_impl);
1321 } 1321 }
1322 1322
1323 // In the site-per-process model, process changes are skipped for chrome://
1324 // subframes for now, since e.g. chrome://settings has multiple "cross-site"
Charlie Reis 2017/01/20 23:32:11 Let's rephrase this a bit to more closely match wh
nasko 2017/01/20 23:51:58 Done.
1325 // chrome:// frames, and that doesn't yet work cross-process.
1326 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() &&
1327 !frame_tree_node_->IsMainFrame()) {
1328 GURL parent_site_url = frame_tree_node_->parent()
Charlie Reis 2017/01/20 23:32:11 nit: const ref
nasko 2017/01/20 23:51:57 No longer present.
1329 ->current_frame_host()
1330 ->GetSiteInstance()
Charlie Reis 2017/01/20 23:32:11 Let's define parent_site_instance as a local varia
nasko 2017/01/20 23:51:57 Done.
1331 ->GetSiteURL();
1332 if (parent_site_url.SchemeIs(kChromeUIScheme) &&
1333 dest_url.SchemeIs(kChromeUIScheme)) {
1334 return SiteInstanceDescriptor(
1335 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance());
1336 }
1337 }
1338
1323 // If we haven't used our SiteInstance (and thus RVH) yet, then we can use it 1339 // If we haven't used our SiteInstance (and thus RVH) yet, then we can use it
1324 // for this entry. We won't commit the SiteInstance to this site until the 1340 // for this entry. We won't commit the SiteInstance to this site until the
1325 // navigation commits (in DidNavigate), unless the navigation entry was 1341 // navigation commits (in DidNavigate), unless the navigation entry was
1326 // restored or it's a Web UI as described below. 1342 // restored or it's a Web UI as described below.
1327 if (!current_instance_impl->HasSite()) { 1343 if (!current_instance_impl->HasSite()) {
1328 // If we've already created a SiteInstance for our destination, we don't 1344 // If we've already created a SiteInstance for our destination, we don't
1329 // want to use this unused SiteInstance; use the existing one. (We don't 1345 // want to use this unused SiteInstance; use the existing one. (We don't
1330 // do this check if the current_instance has a site, because for now, we 1346 // do this check if the current_instance has a site, because for now, we
1331 // want to compare against the current URL and not the SiteInstance's site. 1347 // want to compare against the current URL and not the SiteInstance's site.
1332 // In this case, there is no current URL, so comparing against the site is 1348 // In this case, there is no current URL, so comparing against the site is
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
2763 resolved_url)) { 2779 resolved_url)) {
2764 DCHECK(!dest_instance || 2780 DCHECK(!dest_instance ||
2765 dest_instance == render_frame_host_->GetSiteInstance()); 2781 dest_instance == render_frame_host_->GetSiteInstance());
2766 return false; 2782 return false;
2767 } 2783 }
2768 2784
2769 return true; 2785 return true;
2770 } 2786 }
2771 2787
2772 } // namespace content 2788 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698