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

Unified Diff: third_party/WebKit/Source/core/loader/MixedContentChecker.cpp

Issue 2433413003: Add metrics to measure localhost resources in non-secure contexts. (Closed)
Patch Set: Spelling. Created 4 years, 2 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 | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
diff --git a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
index 1f87e09738f604b3b8c8ee82b06f674b254964fc..a6bb3b0c86e63823f9a94915bfbffb25a23cefd4 100644
--- a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
+++ b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
@@ -430,6 +430,16 @@ void MixedContentChecker::checkMixedPrivatePublic(
frame->document()->addressSpace() == WebAddressSpacePublic) {
UseCounter::count(frame->document(),
UseCounter::MixedContentPrivateHostnameInPublicHostname);
+ // We can simplify the IP checks here, as we've already verified that
+ // |resourceIPAddress| is a reserved IP address, which means it's also a
+ // valid IP address in a normalized form.
+ if (resourceIPAddress.startsWith("127.0.0.") ||
+ resourceIPAddress == "[::1]") {
+ UseCounter::count(frame->document(),
+ frame->document()->isSecureContext()
+ ? UseCounter::LoopbackEmbeddedInSecureContext
+ : UseCounter::LoopbackEmbeddedInNonSecureContext);
+ }
}
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698