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

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

Issue 564123002: Measure resources from private IP addresses in public websites. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Typo. Created 6 years, 3 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 | « Source/core/loader/MixedContentChecker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/MixedContentChecker.cpp
diff --git a/Source/core/loader/MixedContentChecker.cpp b/Source/core/loader/MixedContentChecker.cpp
index b358b2e80b057487a892b41a99c280f9f871d3b9..00409e418bd5dec52c97c2ce510569d8d7d76988 100644
--- a/Source/core/loader/MixedContentChecker.cpp
+++ b/Source/core/loader/MixedContentChecker.cpp
@@ -34,6 +34,7 @@
#include "core/frame/Settings.h"
#include "core/frame/UseCounter.h"
#include "core/inspector/ConsoleMessage.h"
+#include "core/loader/DocumentLoader.h"
#include "core/loader/FrameLoader.h"
#include "core/loader/FrameLoaderClient.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -344,4 +345,19 @@ bool MixedContentChecker::checkFormAction(LocalFrame* frame, const KURL& url)
return true;
}
+void MixedContentChecker::checkMixedPrivatePublic(LocalFrame* frame, const AtomicString& resourceIPAddress)
+{
+ if (!frame || !frame->document() || !frame->document()->loader())
+ return;
+
+ KURL documentIP(ParsedURLString, "http://" + frame->document()->loader()->response().remoteIPAddress());
+ KURL resourceIP(ParsedURLString, "http://" + resourceIPAddress);
+
+ // Just count these for the moment, don't block them.
+ //
+ // FIXME: Once we know how we want to check this, adjust the platform APIs to avoid the KURL construction.
+ if (Platform::current()->isReservedIPAddress(resourceIP) && !Platform::current()->isReservedIPAddress(documentIP))
+ UseCounter::count(frame->document(), UseCounter::MixedContentPrivateHostnameInPublicHostname);
+}
+
} // namespace blink
« no previous file with comments | « Source/core/loader/MixedContentChecker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698