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 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1509 const GURL& dest_url) { | 1509 const GURL& dest_url) { |
1510 // A transfer is not needed if the current SiteInstance doesn't yet have a | 1510 // A transfer is not needed if the current SiteInstance doesn't yet have a |
1511 // site. This is the case for tests that use NavigateToURL. | 1511 // site. This is the case for tests that use NavigateToURL. |
1512 if (!rfh->GetSiteInstance()->HasSite()) | 1512 if (!rfh->GetSiteInstance()->HasSite()) |
1513 return false; | 1513 return false; |
1514 | 1514 |
1515 // We do not currently swap processes for navigations in webview tag guests. | 1515 // We do not currently swap processes for navigations in webview tag guests. |
1516 if (rfh->GetSiteInstance()->GetSiteURL().SchemeIs(kGuestScheme)) | 1516 if (rfh->GetSiteInstance()->GetSiteURL().SchemeIs(kGuestScheme)) |
1517 return false; | 1517 return false; |
1518 | 1518 |
1519 GURL effective_url = SiteInstanceImpl::GetEffectiveURL( | 1519 BrowserContext* context = rfh->GetSiteInstance()->GetBrowserContext(); |
1520 rfh->GetSiteInstance()->GetBrowserContext(), dest_url); | 1520 GURL effective_url = SiteInstanceImpl::GetEffectiveURL(context, dest_url); |
1521 | 1521 |
1522 // TODO(nasko, nick): These following --site-per-process checks are | 1522 // TODO(nasko, nick): These following --site-per-process checks are |
1523 // overly simplistic. Update them to match all the cases | 1523 // overly simplistic. Update them to match all the cases |
1524 // considered by DetermineSiteInstanceForURL. | 1524 // considered by DetermineSiteInstanceForURL. |
1525 if (SiteInstance::IsSameWebSite(rfh->GetSiteInstance()->GetBrowserContext(), | 1525 if (SiteInstance::IsSameWebSite(rfh->GetSiteInstance()->GetBrowserContext(), |
1526 rfh->GetSiteInstance()->GetSiteURL(), | 1526 rfh->GetSiteInstance()->GetSiteURL(), |
1527 dest_url)) { | 1527 dest_url)) { |
1528 return false; // The same site, no transition needed. | 1528 return false; // The same site, no transition needed. |
1529 } | 1529 } |
1530 | 1530 |
1531 // The sites differ. If either one requires a dedicated process, | 1531 // The sites differ. If either one requires a dedicated process, |
1532 // then a transfer is needed. | 1532 // then a transfer is needed. |
1533 return rfh->GetSiteInstance()->RequiresDedicatedProcess() || | 1533 return rfh->GetSiteInstance()->RequiresDedicatedProcess() || |
1534 SiteIsolationPolicy::DoesSiteRequireDedicatedProcess(effective_url); | 1534 SiteInstanceImpl::DoesSiteRequireDedicatedProcess(context, |
| 1535 effective_url); |
1535 } | 1536 } |
1536 | 1537 |
1537 SiteInstance* RenderFrameHostManager::ConvertToSiteInstance( | 1538 SiteInstance* RenderFrameHostManager::ConvertToSiteInstance( |
1538 const SiteInstanceDescriptor& descriptor, | 1539 const SiteInstanceDescriptor& descriptor, |
1539 SiteInstance* candidate_instance) { | 1540 SiteInstance* candidate_instance) { |
1540 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); | 1541 SiteInstance* current_instance = render_frame_host_->GetSiteInstance(); |
1541 | 1542 |
1542 // Note: If the |candidate_instance| matches the descriptor, it will already | 1543 // Note: If the |candidate_instance| matches the descriptor, it will already |
1543 // be set to |descriptor.existing_site_instance|. | 1544 // be set to |descriptor.existing_site_instance|. |
1544 if (descriptor.existing_site_instance) | 1545 if (descriptor.existing_site_instance) |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2622 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { | 2623 int RenderFrameHostManager::GetOpenerRoutingID(SiteInstance* instance) { |
2623 if (!frame_tree_node_->opener()) | 2624 if (!frame_tree_node_->opener()) |
2624 return MSG_ROUTING_NONE; | 2625 return MSG_ROUTING_NONE; |
2625 | 2626 |
2626 return frame_tree_node_->opener() | 2627 return frame_tree_node_->opener() |
2627 ->render_manager() | 2628 ->render_manager() |
2628 ->GetRoutingIdForSiteInstance(instance); | 2629 ->GetRoutingIdForSiteInstance(instance); |
2629 } | 2630 } |
2630 | 2631 |
2631 } // namespace content | 2632 } // namespace content |
OLD | NEW |