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

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

Issue 2702503002: Block renderer-initiated main frame navigations to data URLs (Closed)
Patch Set: Fix Android PDF tests where PDFs should be downloaded 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 cebf02812936fc20df37cf12db7f9e60529357a3..d97c7df4654bfa8082e8c9df2e2b35f236d39d2c 100644
--- a/chrome/browser/tab_contents/navigation_metrics_recorder.cc
+++ b/chrome/browser/tab_contents/navigation_metrics_recorder.cc
@@ -88,6 +88,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());
@@ -96,6 +97,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