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

Unified Diff: chrome/browser/tab_contents/navigation_metrics_recorder.cc

Issue 2787123005: Block data URL navigations with RenderFrameImpl::DecidePolicyForNavigation (Closed)
Patch Set: Attempt another fix Created 3 years, 8 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
Index: chrome/browser/tab_contents/navigation_metrics_recorder.cc
diff --git a/chrome/browser/tab_contents/navigation_metrics_recorder.cc b/chrome/browser/tab_contents/navigation_metrics_recorder.cc
index 1152f0b3397eced7ebddf97e461d55700179eb90..a7b40faaef812daa0a466a6d0cee2ab099814411 100644
--- a/chrome/browser/tab_contents/navigation_metrics_recorder.cc
+++ b/chrome/browser/tab_contents/navigation_metrics_recorder.cc
@@ -95,6 +95,7 @@ void NavigationMetricsRecorder::DidFinishNavigation(
!ui::PageTransitionCoreTypeIs(navigation_handle->GetPageTransition(),
ui::PAGE_TRANSITION_TYPED)) {
if (!navigation_handle->GetPreviousURL().is_empty()) {
+ // TODO(meacer): Remove once data URL navigations are blocked.
rappor::SampleDomainAndRegistryFromGURL(
rappor_service_, "Navigation.Scheme.Data",
navigation_handle->GetPreviousURL());
@@ -103,6 +104,7 @@ void NavigationMetricsRecorder::DidFinishNavigation(
// Also record the mime type of the data: URL.
std::string mime_type;
std::string charset;
+ // TODO(meacer): Remove once data URL navigations are blocked.
if (net::DataURL::Parse(last_committed_entry->GetVirtualURL(), &mime_type,
&charset, nullptr)) {
RecordDataURLMimeType(mime_type);

Powered by Google App Engine
This is Rietveld 408576698