Chromium Code Reviews| Index: Source/core/loader/MixedContentChecker.cpp |
| diff --git a/Source/core/loader/MixedContentChecker.cpp b/Source/core/loader/MixedContentChecker.cpp |
| index b358b2e80b057487a892b41a99c280f9f871d3b9..3247dc615dfc1deb3bb7835c9a8286547b3ec4b7 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,22 @@ bool MixedContentChecker::checkFormAction(LocalFrame* frame, const KURL& url) |
| return true; |
| } |
| +bool MixedContentChecker::checkMixedPrivatePublic(LocalFrame* frame, const AtomicString& resourceIPAddress) |
|
cbentzel
2014/09/12 15:41:10
return bool is not being used.
Probably want to e
Mike West
2014/09/13 04:04:33
Dropped the bool. If/when we decide to start block
|
| +{ |
| + if (!frame || !frame->document() || !frame->document()->loader()) |
| + return false; |
| + |
| + 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); |
| + return true; |
| + } |
| + return false; |
| +} |
| + |
| } // namespace blink |