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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 537983002: Mixed Content: introduce WebURLRequest::RequestContext checks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. 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 | « no previous file | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 4cf0f1faf9e187c1ebd992a41e018025cb6984fb..1bfc3ac7ad6b196d2d0fe497b52af2a5f070c71a 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -299,6 +299,8 @@ ResourcePtr<Resource> ResourceFetcher::fetchSynchronously(FetchRequest& request)
ResourcePtr<ImageResource> ResourceFetcher::fetchImage(FetchRequest& request)
{
+ if (request.resourceRequest().requestContext() == WebURLRequest::RequestContextUnspecified)
+ request.mutableResourceRequest().setRequestContext(WebURLRequest::RequestContextImage);
if (LocalFrame* f = frame()) {
if (f->document()->pageDismissalEventBeingDispatched() != Document::NoDismissal) {
KURL requestURL = request.resourceRequest().url();
@@ -637,9 +639,12 @@ bool ResourceFetcher::canRequest(Resource::Type type, const ResourceRequest& res
}
// FIXME: Should we consider forPreload here?
- if (!checkInsecureContent(type, url, effectiveFrame, effectiveTreatment))
+ if (!checkInsecureContent(type, url, effectiveFrame, effectiveTreatment)) {
+ ASSERT(MixedContentChecker::shouldBlockFetch(effectiveFrame, resourceRequest, url));
return false;
+ }
+ ASSERT(!MixedContentChecker::shouldBlockFetch(effectiveFrame, resourceRequest, url));
return true;
}
« no previous file with comments | « no previous file | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698