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

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

Issue 1151183005: Fix for force reloading an image that was from an ImageDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Adding comment Created 5 years, 6 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 | « no previous file | 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 AtomicString imageSourceURL = m_element->imageSourceURL(); 285 AtomicString imageSourceURL = m_element->imageSourceURL();
286 KURL url = imageSourceToKURL(imageSourceURL); 286 KURL url = imageSourceToKURL(imageSourceURL);
287 ResourcePtr<ImageResource> newImage = 0; 287 ResourcePtr<ImageResource> newImage = 0;
288 RefPtrWillBeRawPtr<Element> protectElement(m_element.get()); 288 RefPtrWillBeRawPtr<Element> protectElement(m_element.get());
289 if (!url.isNull()) { 289 if (!url.isNull()) {
290 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>. 290 // Unlike raw <img>, we block mixed content inside of <picture> or <img srcset>.
291 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions(); 291 ResourceLoaderOptions resourceLoaderOptions = ResourceFetcher::defaultRe sourceOptions();
292 ResourceRequest resourceRequest(url); 292 ResourceRequest resourceRequest(url);
293 resourceRequest.setFetchCredentialsMode(WebURLRequest::FetchCredentialsM odeSameOrigin); 293 resourceRequest.setFetchCredentialsMode(WebURLRequest::FetchCredentialsM odeSameOrigin);
294 if (updateBehavior == UpdateForcedReload) 294 if (updateBehavior == UpdateForcedReload) {
295 resourceRequest.setCachePolicy(ResourceRequestCachePolicy::ReloadByp assingCache); 295 resourceRequest.setCachePolicy(ResourceRequestCachePolicy::ReloadByp assingCache);
296 // ImageLoader defers the load of images when in an ImageDocument. D on't defer this load on a forced reload.
297 m_loadingImageDocument = false;
298 }
296 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull()) 299 if (isHTMLPictureElement(element()->parentNode()) || !element()->fastGet Attribute(HTMLNames::srcsetAttr).isNull())
297 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set); 300 resourceRequest.setRequestContext(WebURLRequest::RequestContextImage Set);
298 FetchRequest request(resourceRequest, element()->localName(), resourceLo aderOptions); 301 FetchRequest request(resourceRequest, element()->localName(), resourceLo aderOptions);
299 configureRequest(request, bypassBehavior, *m_element, document.clientHin tsPreferences()); 302 configureRequest(request, bypassBehavior, *m_element, document.clientHin tsPreferences());
300 303
301 // Prevent the immediate creation of a ResourceLoader (and therefore a n etwork 304 // Prevent the immediate creation of a ResourceLoader (and therefore a n etwork
302 // request) for ImageDocument loads. In this case, the image contents ha ve already 305 // request) for ImageDocument loads. In this case, the image contents ha ve already
303 // been requested as a main resource and ImageDocumentParser will take c are of 306 // been requested as a main resource and ImageDocumentParser will take c are of
304 // funneling the main resource bytes into the ImageResource. 307 // funneling the main resource bytes into the ImageResource.
305 if (m_loadingImageDocument) { 308 if (m_loadingImageDocument) {
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 #endif 663 #endif
661 } 664 }
662 665
663 #if ENABLE(OILPAN) 666 #if ENABLE(OILPAN)
664 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover() 667 ImageLoader::ImageLoaderClientRemover::~ImageLoaderClientRemover()
665 { 668 {
666 m_loader.willRemoveClient(m_client); 669 m_loader.willRemoveClient(m_client);
667 } 670 }
668 #endif 671 #endif
669 } 672 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698