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 <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1262 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 1262 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
1263 switches::kProcessPerTab); | 1263 switches::kProcessPerTab); |
1264 } | 1264 } |
1265 | 1265 |
1266 bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( | 1266 bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( |
1267 const GURL& current_effective_url, | 1267 const GURL& current_effective_url, |
1268 bool current_is_view_source_mode, | 1268 bool current_is_view_source_mode, |
1269 SiteInstance* new_site_instance, | 1269 SiteInstance* new_site_instance, |
1270 const GURL& new_effective_url, | 1270 const GURL& new_effective_url, |
1271 bool new_is_view_source_mode) const { | 1271 bool new_is_view_source_mode) const { |
1272 // Subframe must stay in the same BrowsingInstance as its parent. | |
Charlie Reis
2015/12/04 18:23:23
nit: A subframe
Do we want a TODO for "Ensure tha
nasko
2015/12/04 18:32:33
Done.
| |
1273 if (!frame_tree_node_->IsMainFrame()) | |
1274 return false; | |
1275 | |
1272 // If new_entry already has a SiteInstance, assume it is correct. We only | 1276 // If new_entry already has a SiteInstance, assume it is correct. We only |
1273 // need to force a swap if it is in a different BrowsingInstance. | 1277 // need to force a swap if it is in a different BrowsingInstance. |
1274 if (new_site_instance) { | 1278 if (new_site_instance) { |
1275 return !new_site_instance->IsRelatedSiteInstance( | 1279 return !new_site_instance->IsRelatedSiteInstance( |
1276 render_frame_host_->GetSiteInstance()); | 1280 render_frame_host_->GetSiteInstance()); |
1277 } | 1281 } |
1278 | 1282 |
1279 // Check for reasons to swap processes even if we are in a process model that | 1283 // Check for reasons to swap processes even if we are in a process model that |
1280 // doesn't usually swap (e.g., process-per-tab). Any time we return true, | 1284 // doesn't usually swap (e.g., process-per-tab). Any time we return true, |
1281 // the new_entry will be rendered in a new SiteInstance AND BrowsingInstance. | 1285 // the new_entry will be rendered in a new SiteInstance AND BrowsingInstance. |
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2655 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2659 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
2656 if (!frame_tree_node_->opener()) | 2660 if (!frame_tree_node_->opener()) |
2657 return MSG_ROUTING_NONE; | 2661 return MSG_ROUTING_NONE; |
2658 | 2662 |
2659 return frame_tree_node_->opener() | 2663 return frame_tree_node_->opener() |
2660 ->render_manager() | 2664 ->render_manager() |
2661 ->GetRoutingIdForSiteInstance(instance); | 2665 ->GetRoutingIdForSiteInstance(instance); |
2662 } | 2666 } |
2663 | 2667 |
2664 } // namespace content | 2668 } // namespace content |
OLD | NEW |