| 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 <utility> | 10 #include <utility> |
| (...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1429 frame_tree_node_->opener()->current_frame_host(); | 1429 frame_tree_node_->opener()->current_frame_host(); |
| 1430 if (IsCurrentlySameSite(opener_frame, dest_url)) | 1430 if (IsCurrentlySameSite(opener_frame, dest_url)) |
| 1431 return SiteInstanceDescriptor(opener_frame->GetSiteInstance()); | 1431 return SiteInstanceDescriptor(opener_frame->GetSiteInstance()); |
| 1432 } | 1432 } |
| 1433 } | 1433 } |
| 1434 | 1434 |
| 1435 if (!frame_tree_node_->IsMainFrame() && | 1435 if (!frame_tree_node_->IsMainFrame() && |
| 1436 SiteIsolationPolicy::IsTopDocumentIsolationEnabled() && | 1436 SiteIsolationPolicy::IsTopDocumentIsolationEnabled() && |
| 1437 !SiteInstanceImpl::DoesSiteRequireDedicatedProcess(browser_context, | 1437 !SiteInstanceImpl::DoesSiteRequireDedicatedProcess(browser_context, |
| 1438 dest_url)) { | 1438 dest_url)) { |
| 1439 if (GetContentClient() |
| 1440 ->browser() |
| 1441 ->ShouldFrameShareParentSiteInstanceDespiteTopDocumentIsolation( |
| 1442 dest_url, current_instance)) { |
| 1443 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance()); |
| 1444 } |
| 1445 |
| 1439 // This is a cross-site subframe of a non-isolated origin, so place this | 1446 // This is a cross-site subframe of a non-isolated origin, so place this |
| 1440 // frame in the default subframe site instance. | 1447 // frame in the default subframe site instance. |
| 1441 return SiteInstanceDescriptor( | 1448 return SiteInstanceDescriptor( |
| 1442 browser_context, dest_url, | 1449 browser_context, dest_url, |
| 1443 SiteInstanceRelation::RELATED_DEFAULT_SUBFRAME); | 1450 SiteInstanceRelation::RELATED_DEFAULT_SUBFRAME); |
| 1444 } | 1451 } |
| 1445 | 1452 |
| 1446 // Start the new renderer in a new SiteInstance, but in the current | 1453 // Start the new renderer in a new SiteInstance, but in the current |
| 1447 // BrowsingInstance. | 1454 // BrowsingInstance. |
| 1448 return SiteInstanceDescriptor(browser_context, dest_url, | 1455 return SiteInstanceDescriptor(browser_context, dest_url, |
| (...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2722 resolved_url)) { | 2729 resolved_url)) { |
| 2723 DCHECK(!dest_instance || | 2730 DCHECK(!dest_instance || |
| 2724 dest_instance == render_frame_host_->GetSiteInstance()); | 2731 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2725 return false; | 2732 return false; |
| 2726 } | 2733 } |
| 2727 | 2734 |
| 2728 return true; | 2735 return true; |
| 2729 } | 2736 } |
| 2730 | 2737 |
| 2731 } // namespace content | 2738 } // namespace content |
| OLD | NEW |