| Index: Source/core/loader/MixedContentChecker.h
|
| diff --git a/Source/core/loader/MixedContentChecker.h b/Source/core/loader/MixedContentChecker.h
|
| index f324a02ace2c06d4f5cdcca051ec72338ac63311..0561aa835570f80c0157bb5ace3888547772e71a 100644
|
| --- a/Source/core/loader/MixedContentChecker.h
|
| +++ b/Source/core/loader/MixedContentChecker.h
|
| @@ -49,10 +49,20 @@ class CORE_EXPORT MixedContentChecker final {
|
| DISALLOW_ALLOCATION();
|
| public:
|
| enum ReportingStatus { SendReport, SuppressReport };
|
| - static bool shouldBlockFetch(LocalFrame*, WebURLRequest::RequestContext, WebURLRequest::FrameType, const KURL&, ReportingStatus = SendReport);
|
| - static bool shouldBlockFetch(LocalFrame* frame, const ResourceRequest& request, const KURL& url, ReportingStatus status = SendReport)
|
| +
|
| + static bool shouldBlockFetch(LocalFrame* frame, WebURLRequest::RequestContext context, WebURLRequest::FrameType frameType, const KURL& url, ReportingStatus status = SendReport)
|
| {
|
| - return shouldBlockFetch(frame, request.requestContext(), request.frameType(), url, status);
|
| + return shouldBlockFetch(frame, nullptr, context, frameType, url, status);
|
| + }
|
| +
|
| + // Checks if the given request should be blocked due to mixed
|
| + // content restrictions. Returns true if it should be blocked and
|
| + // false if it should be allowed. Mutates |request| (if not nullptr)
|
| + // to set |request->contextType()| indicating which type of
|
| + // mixed content it is.
|
| + static bool shouldBlockFetch(LocalFrame* frame, ResourceRequest* request, const KURL& url, ReportingStatus status = SendReport)
|
| + {
|
| + return shouldBlockFetch(frame, request, request->requestContext(), request->frameType(), url, status);
|
| }
|
|
|
| static bool shouldBlockWebSocket(LocalFrame*, const KURL&, ReportingStatus = SendReport);
|
| @@ -70,15 +80,11 @@ private:
|
| Submission
|
| };
|
|
|
| - enum ContextType {
|
| - ContextTypeBlockable,
|
| - ContextTypeOptionallyBlockable,
|
| - ContextTypeShouldBeBlockable,
|
| - };
|
| + static bool shouldBlockFetch(LocalFrame*, ResourceRequest*, WebURLRequest::RequestContext, WebURLRequest::FrameType, const KURL&, ReportingStatus = SendReport);
|
|
|
| static LocalFrame* inWhichFrameIsContentMixed(LocalFrame*, WebURLRequest::FrameType, const KURL&);
|
|
|
| - static ContextType contextTypeFromContext(WebURLRequest::RequestContext, LocalFrame*);
|
| + static ResourceRequest::ContextType contextTypeFromContext(WebURLRequest::RequestContext, LocalFrame*);
|
| static const char* typeNameFromContext(WebURLRequest::RequestContext);
|
| static void logToConsoleAboutFetch(LocalFrame*, const KURL&, WebURLRequest::RequestContext, bool allowed);
|
| static void logToConsoleAboutWebSocket(LocalFrame*, const KURL&, bool allowed);
|
|
|