| 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 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1500 const GURL& dest_url) { | 1500 const GURL& dest_url) { |
| 1501 // A transfer is not needed if the current SiteInstance doesn't yet have a | 1501 // A transfer is not needed if the current SiteInstance doesn't yet have a |
| 1502 // site. This is the case for tests that use NavigateToURL. | 1502 // site. This is the case for tests that use NavigateToURL. |
| 1503 if (!rfh->GetSiteInstance()->HasSite()) | 1503 if (!rfh->GetSiteInstance()->HasSite()) |
| 1504 return false; | 1504 return false; |
| 1505 | 1505 |
| 1506 // We do not currently swap processes for navigations in webview tag guests. | 1506 // We do not currently swap processes for navigations in webview tag guests. |
| 1507 if (rfh->GetSiteInstance()->GetSiteURL().SchemeIs(kGuestScheme)) | 1507 if (rfh->GetSiteInstance()->GetSiteURL().SchemeIs(kGuestScheme)) |
| 1508 return false; | 1508 return false; |
| 1509 | 1509 |
| 1510 // Don't swap processes for extensions embedded in DevTools. See | 1510 // Don't swap processes for extensions embedded in DevTools, except for |
| 1511 // https://crbug.com/564216. | 1511 // external navigations in iframes. See https://crbug.com/564216. |
| 1512 |
| 1512 if (rfh->GetSiteInstance()->GetSiteURL().SchemeIs(kChromeDevToolsScheme)) { | 1513 if (rfh->GetSiteInstance()->GetSiteURL().SchemeIs(kChromeDevToolsScheme)) { |
| 1513 // TODO(nick): https://crbug.com/570483 Check to see if |dest_url| is a | 1514 // TODO(davidsac): add more unsafe schemes, or restrict scheme by default |
| 1514 // devtools extension, and swap processes if not. | 1515 if (dest_url.SchemeIs(url::kHttpScheme) || |
| 1516 dest_url.SchemeIs(url::kHttpsScheme)) { |
| 1517 return true; |
| 1518 } |
| 1515 return false; | 1519 return false; |
| 1516 } | 1520 } |
| 1517 | 1521 |
| 1518 BrowserContext* context = rfh->GetSiteInstance()->GetBrowserContext(); | 1522 BrowserContext* context = rfh->GetSiteInstance()->GetBrowserContext(); |
| 1519 // TODO(nasko, nick): These following --site-per-process checks are | 1523 // TODO(nasko, nick): These following --site-per-process checks are |
| 1520 // overly simplistic. Update them to match all the cases | 1524 // overly simplistic. Update them to match all the cases |
| 1521 // considered by DetermineSiteInstanceForURL. | 1525 // considered by DetermineSiteInstanceForURL. |
| 1522 if (IsCurrentlySameSite(rfh, dest_url)) { | 1526 if (IsCurrentlySameSite(rfh, dest_url)) { |
| 1523 // The same site, no transition needed for security purposes, and we must | 1527 // The same site, no transition needed for security purposes, and we must |
| 1524 // keep the same SiteInstance for correctness of synchronous scripting. | 1528 // keep the same SiteInstance for correctness of synchronous scripting. |
| (...skipping 1257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2782 resolved_url)) { | 2786 resolved_url)) { |
| 2783 DCHECK(!dest_instance || | 2787 DCHECK(!dest_instance || |
| 2784 dest_instance == render_frame_host_->GetSiteInstance()); | 2788 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2785 return false; | 2789 return false; |
| 2786 } | 2790 } |
| 2787 | 2791 |
| 2788 return true; | 2792 return true; |
| 2789 } | 2793 } |
| 2790 | 2794 |
| 2791 } // namespace content | 2795 } // namespace content |
| OLD | NEW |