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

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

Issue 598533003: Revert "Mixed Content: Make MixedContentChecker completely static." (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/FrameLoader.cpp ('k') | Source/core/loader/MixedContentChecker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/MixedContentChecker.h
diff --git a/Source/core/loader/MixedContentChecker.h b/Source/core/loader/MixedContentChecker.h
index f9bd906c007be9ae0cbf556ca90e214ef073ab47..7a368a72f018db9500be03c2cf6c99cb89428bca 100644
--- a/Source/core/loader/MixedContentChecker.h
+++ b/Source/core/loader/MixedContentChecker.h
@@ -36,6 +36,7 @@
namespace blink {
+class FrameLoaderClient;
class LocalFrame;
class KURL;
class SecurityOrigin;
@@ -43,14 +44,35 @@ class SecurityOrigin;
class MixedContentChecker {
WTF_MAKE_NONCOPYABLE(MixedContentChecker);
public:
- static bool shouldBlockFetch(LocalFrame*, WebURLRequest::RequestContext, WebURLRequest::FrameType, const KURL&);
- static bool shouldBlockWebSocket(LocalFrame*, const KURL&);
- static bool checkFormAction(LocalFrame*, const KURL&);
+ explicit MixedContentChecker(LocalFrame*);
+
+ static bool shouldBlockFetch(LocalFrame*, const ResourceRequest&, const KURL&);
+
+ bool canDisplayInsecureContent(SecurityOrigin* securityOrigin, const KURL& url) const
+ {
+ return canDisplayInsecureContentInternal(securityOrigin, url, MixedContentChecker::Display);
+ }
+
+ bool canRunInsecureContent(SecurityOrigin* securityOrigin, const KURL& url) const
+ {
+ return canRunInsecureContentInternal(securityOrigin, url, MixedContentChecker::Execution);
+ }
+
+ bool canSubmitToInsecureForm(SecurityOrigin*, const KURL&) const;
+ bool canConnectInsecureWebSocket(SecurityOrigin*, const KURL&) const;
+ bool canFrameInsecureContent(SecurityOrigin*, const KURL&) const;
static bool isMixedContent(SecurityOrigin*, const KURL&);
static void checkMixedPrivatePublic(LocalFrame*, const AtomicString& resourceIPAddress);
private:
+ enum MixedContentType {
+ Display,
+ Execution,
+ WebSocket,
+ Submission
+ };
+
enum ContextType {
ContextTypeBlockable,
ContextTypeOptionallyBlockable,
@@ -58,10 +80,20 @@ private:
ContextTypeBlockableUnlessLax
};
- static LocalFrame* inWhichFrameIsThisContentMixed(LocalFrame*, WebURLRequest::RequestContext, WebURLRequest::FrameType, const KURL&);
static ContextType contextTypeFromContext(WebURLRequest::RequestContext);
static const char* typeNameFromContext(WebURLRequest::RequestContext);
static void logToConsole(LocalFrame*, const KURL&, WebURLRequest::RequestContext, bool allowed);
+
+ // FIXME: This should probably have a separate client from FrameLoader.
+ FrameLoaderClient* client() const;
+
+ bool canDisplayInsecureContentInternal(SecurityOrigin*, const KURL&, const MixedContentType) const;
+
+ bool canRunInsecureContentInternal(SecurityOrigin*, const KURL&, const MixedContentType) const;
+
+ void logWarning(bool allowed, const KURL& i, const MixedContentType) const;
+
+ LocalFrame* m_frame;
};
} // namespace blink
« no previous file with comments | « Source/core/loader/FrameLoader.cpp ('k') | Source/core/loader/MixedContentChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698