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

Side by Side Diff: Source/core/loader/ImageLoader.cpp

Issue 467533002: Aligned srcset mixedContent blocking to the spec (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added a separate test Created 6 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/http/tests/security/mixedContent/resources/frame-with-insecure-empty-srcset.html ('k') | no next file » | 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 if (!document.isActive()) 235 if (!document.isActive())
236 return; 236 return;
237 237
238 AtomicString imageSourceURL = m_element->imageSourceURL(); 238 AtomicString imageSourceURL = m_element->imageSourceURL();
239 KURL url = imageSourceToKURL(imageSourceURL); 239 KURL url = imageSourceToKURL(imageSourceURL);
240 ResourcePtr<ImageResource> newImage = 0; 240 ResourcePtr<ImageResource> newImage = 0;
241 if (!url.isNull()) { 241 if (!url.isNull()) {
242 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 242 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
243 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 243 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
244 ResourceRequest resourceRequest(url); 244 ResourceRequest resourceRequest(url);
245 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isEmpty()) { 245 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull()) {
246 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent; 246 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent;
247 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set); 247 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set);
248 } 248 }
249 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions); 249 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions);
250 configureRequest(request, bypassBehavior, *m_element); 250 configureRequest(request, bypassBehavior, *m_element);
251 251
252 if (m_loadingImageDocument) 252 if (m_loadingImageDocument)
253 newImage = createImageResourceForImageDocument(document, request); 253 newImage = createImageResourceForImageDocument(document, request);
254 else 254 else
255 newImage = document.fetcher()->fetchImage(request); 255 newImage = document.fetcher()->fetchImage(request);
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 } 557 }
558 558
559 #if ENABLE(OILPAN) 559 #if ENABLE(OILPAN)
560 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() 560 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover()
561 { 561 {
562 m_loader.willRemoveClient(m_client); 562 m_loader.willRemoveClient(m_client);
563 } 563 }
564 #endif 564 #endif
565 565
566 } 566 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/security/mixedContent/resources/frame-with-insecure-empty-srcset.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698