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 |