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

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

Issue 1299493003: Attach mixed content status to resource requests when sent to devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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
Index: Source/core/loader/MixedContentChecker.cpp
diff --git a/Source/core/loader/MixedContentChecker.cpp b/Source/core/loader/MixedContentChecker.cpp
index 449058f80cec9b82bb8e0a250f6ee313b3b95c8c..078268bc0f91d1cd9c9ce751d06909e55435e864 100644
--- a/Source/core/loader/MixedContentChecker.cpp
+++ b/Source/core/loader/MixedContentChecker.cpp
@@ -292,7 +292,7 @@ void MixedContentChecker::count(LocalFrame* frame, WebURLRequest::RequestContext
}
// static
-bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::RequestContext requestContext, WebURLRequest::FrameType frameType, const KURL& url, MixedContentChecker::ReportingStatus reportingStatus)
+bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, ResourceRequest* request, WebURLRequest::RequestContext requestContext, WebURLRequest::FrameType frameType, const KURL& url, MixedContentChecker::ReportingStatus reportingStatus)
{
LocalFrame* mixedFrame = inWhichFrameIsContentMixed(frame, frameType, url);
if (!mixedFrame)
@@ -323,8 +323,10 @@ bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::Req
switch (contextType) {
case ContextTypeOptionallyBlockable:
allowed = !strictMode && client->allowDisplayingInsecureContent(settings && settings->allowDisplayOfInsecureContent(), securityOrigin, url);
- if (allowed)
+ if (allowed) {
client->didDisplayInsecureContent();
+ request->setMixedContentStatus(ResourceRequest::PassiveMixedContent);
+ }
break;
case ContextTypeBlockable: {
@@ -333,14 +335,17 @@ bool MixedContentChecker::shouldBlockFetch(LocalFrame* frame, WebURLRequest::Req
if (allowed) {
client->didRunInsecureContent(securityOrigin, url);
UseCounter::count(mixedFrame, UseCounter::MixedContentBlockableAllowed);
+ request->setMixedContentStatus(ResourceRequest::ActiveMixedContent);
}
break;
}
case ContextTypeShouldBeBlockable:
allowed = !strictMode;
- if (allowed)
+ if (allowed) {
client->didDisplayInsecureContent();
+ request->setMixedContentStatus(ResourceRequest::PassiveMixedContent);
+ }
break;
};

Powered by Google App Engine
This is Rietveld 408576698