Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1522)

Side by Side Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 2541063002: Revert of Remove about:srcdoc url conversion. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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, about:srcdoc pages and 1409 // Use the source SiteInstance in case of data URLs or about:blank pages,
1410 // about:blank pages because the content is then controlled and/or scriptable 1410 // because the content is then controlled and/or scriptable by the source
1411 // by the source SiteInstance. 1411 // SiteInstance.
1412 GURL about_blank(url::kAboutBlankURL); 1412 GURL about_blank(url::kAboutBlankURL);
1413 GURL about_srcdoc(content::kAboutSrcDocURL); 1413 if (source_instance &&
1414 if (source_instance && (dest_url == about_srcdoc || dest_url == about_blank || 1414 (dest_url == about_blank || dest_url.scheme() == url::kDataScheme)) {
1415 dest_url.scheme() == url::kDataScheme)) {
1416 return SiteInstanceDescriptor(source_instance); 1415 return SiteInstanceDescriptor(source_instance);
1417 } 1416 }
1418 1417
1419 // Use the current SiteInstance for same site navigations. 1418 // Use the current SiteInstance for same site navigations.
1420 if (IsCurrentlySameSite(render_frame_host_.get(), dest_url)) 1419 if (IsCurrentlySameSite(render_frame_host_.get(), dest_url))
1421 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance()); 1420 return SiteInstanceDescriptor(render_frame_host_->GetSiteInstance());
1422 1421
1423 if (SiteIsolationPolicy::IsTopDocumentIsolationEnabled()) { 1422 if (SiteIsolationPolicy::IsTopDocumentIsolationEnabled()) {
1424 // TODO(nick): Looking at the main frame and openers is required for TDI 1423 // TODO(nick): Looking at the main frame and openers is required for TDI
1425 // mode, but should be safe to enable unconditionally. 1424 // mode, but should be safe to enable unconditionally.
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 resolved_url)) { 2735 resolved_url)) {
2737 DCHECK(!dest_instance || 2736 DCHECK(!dest_instance ||
2738 dest_instance == render_frame_host_->GetSiteInstance()); 2737 dest_instance == render_frame_host_->GetSiteInstance());
2739 return false; 2738 return false;
2740 } 2739 }
2741 2740
2742 return true; 2741 return true;
2743 } 2742 }
2744 2743
2745 } // namespace content 2744 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698