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

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

Issue 418783002: Revert 178571 "Teach ContentSecurityPolicy about WebURLRequest::..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 5 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
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 234
235 AtomicString imageSourceURL = m_element->imageSourceURL(); 235 AtomicString imageSourceURL = m_element->imageSourceURL();
236 KURL url = imageSourceToKURL(imageSourceURL); 236 KURL url = imageSourceToKURL(imageSourceURL);
237 ResourcePtr<ImageResource> newImage = 0; 237 ResourcePtr<ImageResource> newImage = 0;
238 if (!url.isNull()) { 238 if (!url.isNull()) {
239 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 239 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
240 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 240 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
241 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isEmpty()) 241 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isEmpty())
242 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent; 242 resourceLoaderOptions.mixedContentBlockingTreatment = TreatAsActiveC ontent;
243 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions); 243 FetchRequest request(ResourceRequest(url), element()->localName(), resou rceLoaderOptions);
244 request.mutableResourceRequest().setRequestContext(blink::WebURLRequest: :RequestContextImage);
245 configureRequest(request, bypassBehavior, *m_element); 244 configureRequest(request, bypassBehavior, *m_element);
246 245
247 if (m_loadingImageDocument) 246 if (m_loadingImageDocument)
248 newImage = createImageResourceForImageDocument(document, request); 247 newImage = createImageResourceForImageDocument(document, request);
249 else 248 else
250 newImage = document.fetcher()->fetchImage(request); 249 newImage = document.fetcher()->fetchImage(request);
251 250
252 if (!newImage && !pageIsBeingDismissed(&document)) 251 if (!newImage && !pageIsBeingDismissed(&document))
253 crossSiteOrCSPViolationOccured(imageSourceURL); 252 crossSiteOrCSPViolationOccured(imageSourceURL);
254 else 253 else
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 } 549 }
551 550
552 #if ENABLE(OILPAN) 551 #if ENABLE(OILPAN)
553 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() 552 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover()
554 { 553 {
555 m_loader.willRemoveClient(m_client); 554 m_loader.willRemoveClient(m_client);
556 } 555 }
557 #endif 556 #endif
558 557
559 } 558 }
OLDNEW
« no previous file with comments | « trunk/Source/core/html/parser/HTMLResourcePreloader.cpp ('k') | trunk/Source/core/xml/XSLTProcessorLibxslt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698