Chromium Code Reviews| 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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1017 : existing_site_instance(nullptr), relation(relation_to_current) { | 1017 : existing_site_instance(nullptr), relation(relation_to_current) { |
| 1018 new_site_url = SiteInstance::GetSiteForURL(browser_context, dest_url); | 1018 new_site_url = SiteInstance::GetSiteForURL(browser_context, dest_url); |
| 1019 } | 1019 } |
| 1020 | 1020 |
| 1021 void RenderFrameHostManager::RenderProcessGone(SiteInstanceImpl* instance) { | 1021 void RenderFrameHostManager::RenderProcessGone(SiteInstanceImpl* instance) { |
| 1022 GetRenderFrameProxyHost(instance)->set_render_frame_proxy_created(false); | 1022 GetRenderFrameProxyHost(instance)->set_render_frame_proxy_created(false); |
| 1023 } | 1023 } |
| 1024 | 1024 |
| 1025 void RenderFrameHostManager::CancelPendingIfNecessary( | 1025 void RenderFrameHostManager::CancelPendingIfNecessary( |
| 1026 RenderFrameHostImpl* render_frame_host) { | 1026 RenderFrameHostImpl* render_frame_host) { |
| 1027 if (render_frame_host == pending_render_frame_host_.get()) | 1027 if (render_frame_host == pending_render_frame_host_.get()) { |
| 1028 CancelPending(); | 1028 CancelPending(); |
| 1029 else if (render_frame_host == speculative_render_frame_host_.get()) { | 1029 } else if (render_frame_host == speculative_render_frame_host_.get()) { |
| 1030 // TODO(nasko, clamy): This should just clean up the speculative RFH | 1030 // TODO(nasko, clamy): This should just clean up the speculative RFH |
| 1031 // without canceling the request. See https://crbug.com/636119. | 1031 // without canceling the request. See https://crbug.com/636119. |
| 1032 if (frame_tree_node_->navigation_request() && | 1032 if (frame_tree_node_->navigation_request() && |
| 1033 frame_tree_node_->navigation_request()->navigation_handle()) { | 1033 frame_tree_node_->navigation_request()->navigation_handle()) { |
| 1034 frame_tree_node_->navigation_request() | 1034 frame_tree_node_->navigation_request() |
| 1035 ->navigation_handle() | 1035 ->navigation_handle() |
| 1036 ->set_net_error_code(net::ERR_ABORTED); | 1036 ->set_net_error_code(net::ERR_ABORTED); |
| 1037 } | 1037 } |
| 1038 frame_tree_node_->ResetNavigationRequest(false, true); | 1038 frame_tree_node_->ResetNavigationRequest(false, true); |
| 1039 } | 1039 } |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1478 frame_tree_node_->opener()->current_frame_host(); | 1478 frame_tree_node_->opener()->current_frame_host(); |
| 1479 if (IsCurrentlySameSite(opener_frame, dest_url)) | 1479 if (IsCurrentlySameSite(opener_frame, dest_url)) |
| 1480 return SiteInstanceDescriptor(opener_frame->GetSiteInstance()); | 1480 return SiteInstanceDescriptor(opener_frame->GetSiteInstance()); |
| 1481 } | 1481 } |
| 1482 } | 1482 } |
| 1483 | 1483 |
| 1484 if (!frame_tree_node_->IsMainFrame() && | 1484 if (!frame_tree_node_->IsMainFrame() && |
| 1485 SiteIsolationPolicy::IsTopDocumentIsolationEnabled() && | 1485 SiteIsolationPolicy::IsTopDocumentIsolationEnabled() && |
| 1486 !SiteInstanceImpl::DoesSiteRequireDedicatedProcess(browser_context, | 1486 !SiteInstanceImpl::DoesSiteRequireDedicatedProcess(browser_context, |
| 1487 dest_url)) { | 1487 dest_url)) { |
| 1488 if (GetContentClient() | 1488 RenderFrameHostImpl* main_frame = |
| 1489 ->browser() | 1489 frame_tree_node_->frame_tree()->root()->current_frame_host(); |
| 1490 ->ShouldFrameShareParentSiteInstanceDespiteTopDocumentIsolation( | 1490 if (GetContentClient()->browser()->ShouldIsolateFrameFromMainContent( |
|
Charlie Reis
2017/06/30 23:28:45
Hmm. It feels a little odd to have the embedder m
Łukasz Anforowicz
2017/07/01 00:10:53
Do you think that maybe the base::Feature for TopD
Charlie Reis
2017/07/06 20:02:29
I think I'd rather keep it in content. Among othe
| |
| 1491 dest_url, current_instance)) { | 1491 frame_tree_node_->current_frame_host(), dest_url, |
| 1492 main_frame->GetSiteInstance())) { | |
| 1493 // This is a cross-site subframe of a non-isolated origin, so place this | |
| 1494 // frame in the default subframe site instance. | |
| 1495 return SiteInstanceDescriptor( | |
| 1496 browser_context, dest_url, | |
| 1497 SiteInstanceRelation::RELATED_DEFAULT_SUBFRAME); | |
| 1498 } else { | |
| 1492 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance()); | 1499 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance()); |
| 1493 } | 1500 } |
| 1494 | |
| 1495 // This is a cross-site subframe of a non-isolated origin, so place this | |
| 1496 // frame in the default subframe site instance. | |
| 1497 return SiteInstanceDescriptor( | |
| 1498 browser_context, dest_url, | |
| 1499 SiteInstanceRelation::RELATED_DEFAULT_SUBFRAME); | |
| 1500 } | 1501 } |
| 1501 | 1502 |
| 1502 // Keep subframes in the parent's SiteInstance unless a dedicated process is | 1503 // Keep subframes in the parent's SiteInstance unless a dedicated process is |
| 1503 // required for either the parent or the subframe's destination URL. This | 1504 // required for either the parent or the subframe's destination URL. This |
| 1504 // isn't a strict invariant but rather a heuristic to avoid unnecessary | 1505 // isn't a strict invariant but rather a heuristic to avoid unnecessary |
| 1505 // OOPIFs; see https://crbug.com/711006. Note that this shouldn't apply to | 1506 // OOPIFs; see https://crbug.com/711006. Note that this shouldn't apply to |
| 1506 // TopDocumentIsolation, so do this after TDI checks above. | 1507 // TopDocumentIsolation, so do this after TDI checks above. |
| 1507 if (!frame_tree_node_->IsMainFrame()) { | 1508 if (!frame_tree_node_->IsMainFrame()) { |
| 1508 RenderFrameHostImpl* parent = | 1509 RenderFrameHostImpl* parent = |
| 1509 frame_tree_node_->parent()->current_frame_host(); | 1510 frame_tree_node_->parent()->current_frame_host(); |
| (...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2829 ->is_hidden() != delegate_->IsHidden()) { | 2830 ->is_hidden() != delegate_->IsHidden()) { |
| 2830 if (delegate_->IsHidden()) { | 2831 if (delegate_->IsHidden()) { |
| 2831 view->Hide(); | 2832 view->Hide(); |
| 2832 } else { | 2833 } else { |
| 2833 view->Show(); | 2834 view->Show(); |
| 2834 } | 2835 } |
| 2835 } | 2836 } |
| 2836 } | 2837 } |
| 2837 | 2838 |
| 2838 } // namespace content | 2839 } // namespace content |
| OLD | NEW |