| 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 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1399 // chrome://crash, however. | 1399 // chrome://crash, however. |
| 1400 // TODO(creis): Refactor this method so this duplicated code isn't needed. | 1400 // TODO(creis): Refactor this method so this duplicated code isn't needed. |
| 1401 // See http://crbug.com/123007. | 1401 // See http://crbug.com/123007. |
| 1402 if (current_entry && | 1402 if (current_entry && |
| 1403 current_entry->IsViewSourceMode() != dest_is_view_source_mode && | 1403 current_entry->IsViewSourceMode() != dest_is_view_source_mode && |
| 1404 !IsRendererDebugURL(dest_url)) { | 1404 !IsRendererDebugURL(dest_url)) { |
| 1405 return SiteInstanceDescriptor(browser_context, dest_url, | 1405 return SiteInstanceDescriptor(browser_context, dest_url, |
| 1406 SiteInstanceRelation::UNRELATED); | 1406 SiteInstanceRelation::UNRELATED); |
| 1407 } | 1407 } |
| 1408 | 1408 |
| 1409 // Use the source SiteInstance in case of data URLs or about:blank pages, | 1409 // Use the source SiteInstance in case of data URLs, about:srcdoc pages and |
| 1410 // because the content is then controlled and/or scriptable by the source | 1410 // about:blank pages because the content is then controlled and/or scriptable |
| 1411 // SiteInstance. | 1411 // by the source SiteInstance. |
| 1412 GURL about_blank(url::kAboutBlankURL); | 1412 GURL about_blank(url::kAboutBlankURL); |
| 1413 if (source_instance && | 1413 GURL about_srcdoc(content::kAboutSrcDocURL); |
| 1414 (dest_url == about_blank || dest_url.scheme() == url::kDataScheme)) { | 1414 if (source_instance && (dest_url == about_srcdoc || dest_url == about_blank || |
| 1415 dest_url.scheme() == url::kDataScheme)) { |
| 1415 return SiteInstanceDescriptor(source_instance); | 1416 return SiteInstanceDescriptor(source_instance); |
| 1416 } | 1417 } |
| 1417 | 1418 |
| 1418 // Use the current SiteInstance for same site navigations. | 1419 // Use the current SiteInstance for same site navigations. |
| 1419 if (IsCurrentlySameSite(render_frame_host_.get(), dest_url)) | 1420 if (IsCurrentlySameSite(render_frame_host_.get(), dest_url)) |
| 1420 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance()); | 1421 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance()); |
| 1421 | 1422 |
| 1422 if (SiteIsolationPolicy::IsTopDocumentIsolationEnabled()) { | 1423 if (SiteIsolationPolicy::IsTopDocumentIsolationEnabled()) { |
| 1423 // TODO(nick): Looking at the main frame and openers is required for TDI | 1424 // TODO(nick): Looking at the main frame and openers is required for TDI |
| 1424 // mode, but should be safe to enable unconditionally. | 1425 // mode, but should be safe to enable unconditionally. |
| (...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2735 resolved_url)) { | 2736 resolved_url)) { |
| 2736 DCHECK(!dest_instance || | 2737 DCHECK(!dest_instance || |
| 2737 dest_instance == render_frame_host_->GetSiteInstance()); | 2738 dest_instance == render_frame_host_->GetSiteInstance()); |
| 2738 return false; | 2739 return false; |
| 2739 } | 2740 } |
| 2740 | 2741 |
| 2741 return true; | 2742 return true; |
| 2742 } | 2743 } |
| 2743 | 2744 |
| 2744 } // namespace content | 2745 } // namespace content |
| OLD | NEW |