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

Unified Diff: content/browser/frame_host/navigation_handle_impl.cc

Issue 2694903007: Add a warning for the deprecation of content-initiated data URL navigations (Closed)
Patch Set: creis comments Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_handle_impl.cc
diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc
index 74e0b202c6f005ffc79bb32c909b01bb847c83f2..e0cce691db21752db0699c8128b27190711c3ed8 100644
--- a/content/browser/frame_host/navigation_handle_impl.cc
+++ b/content/browser/frame_host/navigation_handle_impl.cc
@@ -638,6 +638,14 @@ void NavigationHandleImpl::DidCommitNavigation(
} else {
state_ = DID_COMMIT;
}
+
+ if (url_.SchemeIs(url::kDataScheme) && IsInMainFrame() &&
+ IsRendererInitiated()) {
+ GetRenderFrameHost()->AddMessageToConsole(
+ CONSOLE_MESSAGE_LEVEL_WARNING,
+ "Upcoming versions will block content-initiated top frame navigations "
+ "to data: URLs. For more information, see https://goo.gl/BaZAea.");
+ }
}
void NavigationHandleImpl::Transfer() {
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698