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

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

Issue 605453002: Merge 182515 "Revert "Mixed Content: Make MixedContentChecker co..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/2167/
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
===================================================================
--- Source/core/loader/MixedContentChecker.h (revision 182628)
+++ Source/core/loader/MixedContentChecker.h (working copy)
@@ -36,6 +36,7 @@
namespace blink {
+class FrameLoaderClient;
class LocalFrame;
class KURL;
class SecurityOrigin;
@@ -43,14 +44,35 @@
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 @@
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