Chromium Code Reviews| Index: Source/core/dom/DocumentInit.cpp |
| diff --git a/Source/core/dom/DocumentInit.cpp b/Source/core/dom/DocumentInit.cpp |
| index 1aa80ce299c02316582a410b315dbbbe9d8b6a63..1619d93ef3819d81171b98cb31391cadf2b7d40f 100644 |
| --- a/Source/core/dom/DocumentInit.cpp |
| +++ b/Source/core/dom/DocumentInit.cpp |
| @@ -33,7 +33,9 @@ |
| #include "core/frame/LocalFrame.h" |
| #include "core/html/HTMLFrameOwnerElement.h" |
| #include "core/html/imports/HTMLImportsController.h" |
| +#include "core/loader/DocumentLoader.h" |
| #include "platform/RuntimeEnabledFeatures.h" |
| +#include "public/platform/Platform.h" |
| namespace blink { |
| @@ -123,6 +125,20 @@ bool DocumentInit::shouldEnforceStrictMixedContentChecking() const |
| return frameForSecurityContext()->loader().shouldEnforceStrictMixedContentChecking(); |
| } |
| +bool DocumentInit::isHostedInReservedIPRange() const |
| +{ |
| + if (LocalFrame* frame = frameForSecurityContext()) { |
| + // TODO: Fix the platform API to drop the KURL construction. |
|
jochen (gone - plz use gerrit)
2015/01/13 15:04:55
it's FIXME in blink
Mike West
2015/01/13 15:35:38
Done.
|
| + if (DocumentLoader* loader = frame->loader().provisionalDocumentLoader() ? frame->loader().provisionalDocumentLoader() : frame->loader().documentLoader()) { |
| + if (!loader->response().remoteIPAddress().isEmpty()) { |
| + KURL documentIP(ParsedURLString, "http://" + loader->response().remoteIPAddress()); |
|
jochen (gone - plz use gerrit)
2015/01/13 15:04:54
https:// - be a good role model :)
otoh, why does
Mike West
2015/01/13 15:35:38
Ha! Done.
|
| + return Platform::current()->isReservedIPAddress(documentIP); |
| + } |
| + } |
| + } |
| + return false; |
| +} |
| + |
| Settings* DocumentInit::settings() const |
| { |
| ASSERT(frameForSecurityContext()); |