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

Side by Side Diff: Source/core/loader/ImageLoader.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/loader/MixedContentChecker.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed. 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights reserv ed.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 KURL url = imageSourceToKURL(imageSourceURL); 249 KURL url = imageSourceToKURL(imageSourceURL);
250 ResourcePtr<ImageResource> newImage = 0; 250 ResourcePtr<ImageResource> newImage = 0;
251 if (!url.isNull()) { 251 if (!url.isNull()) {
252 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 252 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
253 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 253 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
254 ResourceRequest resourceRequest(url); 254 ResourceRequest resourceRequest(url);
255 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull()) { 255 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull()) {
256 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent; 256 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent;
257 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set); 257 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set);
258 } 258 }
259 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions); 259 FetchRequest request(resourceRequest, element()->localName(), resourceLo aderOptions);
260 configureRequest(request, bypassBehavior, *m_element); 260 configureRequest(request, bypassBehavior, *m_element);
261 261
262 if (m_loadingImageDocument) 262 if (m_loadingImageDocument)
263 newImage = createImageResourceForImageDocument(document, request); 263 newImage = createImageResourceForImageDocument(document, request);
264 else 264 else
265 newImage = document.fetcher()->fetchImage(request); 265 newImage = document.fetcher()->fetchImage(request);
266 266
267 if (!newImage && !pageIsBeingDismissed(&document)) 267 if (!newImage && !pageIsBeingDismissed(&document))
268 crossSiteOrCSPViolationOccured(imageSourceURL); 268 crossSiteOrCSPViolationOccured(imageSourceURL);
269 else 269 else
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 } 571 }
572 572
573 #if ENABLE(OILPAN) 573 #if ENABLE(OILPAN)
574 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() 574 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover()
575 { 575 {
576 m_loader.willRemoveClient(m_client); 576 m_loader.willRemoveClient(m_client);
577 } 577 }
578 #endif 578 #endif
579 579
580 } 580 }
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/loader/MixedContentChecker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698