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

Unified Diff: Source/core/dom/DocumentInit.cpp

Issue 845303003: Tag SecurityContext objects as being hosted in reserved IP ranges. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Feedback. Created 5 years, 11 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/dom/DocumentInit.h ('k') | Source/core/dom/SecurityContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentInit.cpp
diff --git a/Source/core/dom/DocumentInit.cpp b/Source/core/dom/DocumentInit.cpp
index 1aa80ce299c02316582a410b315dbbbe9d8b6a63..c57120c6d3783ee5ffa2d66652c864cb4e523560 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,17 @@ bool DocumentInit::shouldEnforceStrictMixedContentChecking() const
return frameForSecurityContext()->loader().shouldEnforceStrictMixedContentChecking();
}
+bool DocumentInit::isHostedInReservedIPRange() const
+{
+ if (LocalFrame* frame = frameForSecurityContext()) {
+ if (DocumentLoader* loader = frame->loader().provisionalDocumentLoader() ? frame->loader().provisionalDocumentLoader() : frame->loader().documentLoader()) {
+ if (!loader->response().remoteIPAddress().isEmpty())
+ return Platform::current()->isReservedIPAddress(loader->response().remoteIPAddress());
+ }
+ }
+ return false;
+}
+
Settings* DocumentInit::settings() const
{
ASSERT(frameForSecurityContext());
« no previous file with comments | « Source/core/dom/DocumentInit.h ('k') | Source/core/dom/SecurityContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698