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 <utility> | 10 #include <utility> |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1394 // chrome://crash, however. | 1394 // chrome://crash, however. |
1395 // TODO(creis): Refactor this method so this duplicated code isn't needed. | 1395 // TODO(creis): Refactor this method so this duplicated code isn't needed. |
1396 // See http://crbug.com/123007. | 1396 // See http://crbug.com/123007. |
1397 if (current_entry && | 1397 if (current_entry && |
1398 current_entry->IsViewSourceMode() != dest_is_view_source_mode && | 1398 current_entry->IsViewSourceMode() != dest_is_view_source_mode && |
1399 !IsRendererDebugURL(dest_url)) { | 1399 !IsRendererDebugURL(dest_url)) { |
1400 return SiteInstanceDescriptor(browser_context, dest_url, | 1400 return SiteInstanceDescriptor(browser_context, dest_url, |
1401 SiteInstanceRelation::UNRELATED); | 1401 SiteInstanceRelation::UNRELATED); |
1402 } | 1402 } |
1403 | 1403 |
1404 // Use the source SiteInstance in case of data URLs or about:blank pages, | 1404 // Use the source SiteInstance in case of data URLs, about:srcdoc pages and |
1405 // because the content is then controlled and/or scriptable by the source | 1405 // about:blank pages because the content is then controlled and/or scriptable |
1406 // SiteInstance. | 1406 // by the source SiteInstance. |
1407 GURL about_blank(url::kAboutBlankURL); | 1407 GURL about_blank(url::kAboutBlankURL); |
1408 if (source_instance && | 1408 GURL about_srcdoc(content::kAboutSrcDocURL); |
1409 (dest_url == about_blank || dest_url.scheme() == url::kDataScheme)) { | 1409 if (source_instance && (dest_url == about_srcdoc || dest_url == about_blank || |
Charlie Reis
2016/11/11 22:53:24
Good catch-- that seems right to me. (I suppose t
arthursonzogni
2016/11/15 16:37:09
FYI, this modification fixes the test:
FrameTreeBr
Charlie Reis
2016/11/16 18:20:22
I'm not sure if that ever gets called for subframe
| |
1410 dest_url.scheme() == url::kDataScheme)) { | |
1410 return SiteInstanceDescriptor(source_instance); | 1411 return SiteInstanceDescriptor(source_instance); |
1411 } | 1412 } |
1412 | 1413 |
1413 // Use the current SiteInstance for same site navigations. | 1414 // Use the current SiteInstance for same site navigations. |
1414 if (IsCurrentlySameSite(render_frame_host_.get(), dest_url)) | 1415 if (IsCurrentlySameSite(render_frame_host_.get(), dest_url)) |
1415 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance()); | 1416 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance()); |
1416 | 1417 |
1417 if (SiteIsolationPolicy::IsTopDocumentIsolationEnabled()) { | 1418 if (SiteIsolationPolicy::IsTopDocumentIsolationEnabled()) { |
1418 // TODO(nick): Looking at the main frame and openers is required for TDI | 1419 // TODO(nick): Looking at the main frame and openers is required for TDI |
1419 // mode, but should be safe to enable unconditionally. | 1420 // mode, but should be safe to enable unconditionally. |
(...skipping 1302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2722 resolved_url)) { | 2723 resolved_url)) { |
2723 DCHECK(!dest_instance || | 2724 DCHECK(!dest_instance || |
2724 dest_instance == render_frame_host_->GetSiteInstance()); | 2725 dest_instance == render_frame_host_->GetSiteInstance()); |
2725 return false; | 2726 return false; |
2726 } | 2727 } |
2727 | 2728 |
2728 return true; | 2729 return true; |
2729 } | 2730 } |
2730 | 2731 |
2731 } // namespace content | 2732 } // namespace content |
OLD | NEW |