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

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

Issue 1802123002: Unify Resource loading status tracking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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
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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 // request) for ImageDocument loads. In this case, the image contents ha ve already 319 // request) for ImageDocument loads. In this case, the image contents ha ve already
320 // been requested as a main resource and ImageDocumentParser will take c are of 320 // been requested as a main resource and ImageDocumentParser will take c are of
321 // funneling the main resource bytes into the ImageResource. 321 // funneling the main resource bytes into the ImageResource.
322 if (m_loadingImageDocument) { 322 if (m_loadingImageDocument) {
323 request.setDefer(FetchRequest::DeferredByClient); 323 request.setDefer(FetchRequest::DeferredByClient);
324 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy); 324 request.setContentSecurityCheck(DoNotCheckContentSecurityPolicy);
325 } 325 }
326 326
327 newImage = ImageResource::fetch(request, document.fetcher()); 327 newImage = ImageResource::fetch(request, document.fetcher());
328 if (m_loadingImageDocument && newImage) 328 if (m_loadingImageDocument && newImage)
329 newImage->setLoading(true); 329 newImage->setStatus(Resource::Pending);
330 330
331 if (!newImage && !pageIsBeingDismissed(&document)) { 331 if (!newImage && !pageIsBeingDismissed(&document)) {
332 crossSiteOrCSPViolationOccurred(imageSourceURL); 332 crossSiteOrCSPViolationOccurred(imageSourceURL);
333 dispatchErrorEvent(); 333 dispatchErrorEvent();
334 } else { 334 } else {
335 clearFailedLoadURL(); 335 clearFailedLoadURL();
336 } 336 }
337 } else { 337 } else {
338 if (!imageSourceURL.isNull()) { 338 if (!imageSourceURL.isNull()) {
339 // Fire an error event if the url string is not empty, but the KURL is. 339 // Fire an error event if the url string is not empty, but the KURL is.
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 626
627 void ImageLoader::elementDidMoveToNewDocument() 627 void ImageLoader::elementDidMoveToNewDocument()
628 { 628 {
629 if (m_loadDelayCounter) 629 if (m_loadDelayCounter)
630 m_loadDelayCounter->documentChanged(m_element->document()); 630 m_loadDelayCounter->documentChanged(m_element->document());
631 clearFailedLoadURL(); 631 clearFailedLoadURL();
632 setImage(0); 632 setImage(0);
633 } 633 }
634 634
635 } // namespace blink 635 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698