| 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_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 Loading... |
| 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 // If the parent frame is a chrome:// page and the subframe is as well, keep |
| 1324 // the subframe in the parent's process even if they would be considered |
| 1325 // different sites. This avoids unnecessary OOPIFs on pages like |
| 1326 // chrome://settings, which currently has multiple "cross-site" subframes that |
| 1327 // don't need isolation. |
| 1328 if (SiteIsolationPolicy::AreCrossProcessFramesPossible() && |
| 1329 !frame_tree_node_->IsMainFrame()) { |
| 1330 SiteInstance* parent_site_instance = |
| 1331 frame_tree_node_->parent()->current_frame_host()->GetSiteInstance(); |
| 1332 if (parent_site_instance->GetSiteURL().SchemeIs(kChromeUIScheme) && |
| 1333 dest_url.SchemeIs(kChromeUIScheme)) { |
| 1334 return SiteInstanceDescriptor(parent_site_instance); |
| 1335 } |
| 1336 } |
| 1337 |
| 1323 // If we haven't used our SiteInstance (and thus RVH) yet, then we can use it | 1338 // 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 | 1339 // for this entry. We won't commit the SiteInstance to this site until the |
| 1325 // navigation commits (in DidNavigate), unless the navigation entry was | 1340 // navigation commits (in DidNavigate), unless the navigation entry was |
| 1326 // restored or it's a Web UI as described below. | 1341 // restored or it's a Web UI as described below. |
| 1327 if (!current_instance_impl->HasSite()) { | 1342 if (!current_instance_impl->HasSite()) { |
| 1328 // If we've already created a SiteInstance for our destination, we don't | 1343 // 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 | 1344 // 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 | 1345 // 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. | 1346 // 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 | 1347 // 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 Loading... |
| 2763 resolved_url)) { | 2778 resolved_url)) { |
| 2764 DCHECK(!dest_instance || | 2779 DCHECK(!dest_instance || |
| 2765 dest_instance == render_frame_host_->GetSiteInstance()); | 2780 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2766 return false; | 2781 return false; |
| 2767 } | 2782 } |
| 2768 | 2783 |
| 2769 return true; | 2784 return true; |
| 2770 } | 2785 } |
| 2771 | 2786 |
| 2772 } // namespace content | 2787 } // namespace content |
| OLD | NEW |