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

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

Issue 2592113003: Load data URI images in an async way according to spec (take 3) (Closed)
Patch Set: Fixed more devtools reliance on sync loading Created 3 years, 11 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 4 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010 Apple Inc. All rights
5 * reserved. 5 * reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 bool ImageLoader::shouldLoadImmediately(const KURL& url) const { 459 bool ImageLoader::shouldLoadImmediately(const KURL& url) const {
460 // We force any image loads which might require alt content through the 460 // We force any image loads which might require alt content through the
461 // asynchronous path so that we can add the shadow DOM for the alt-text 461 // asynchronous path so that we can add the shadow DOM for the alt-text
462 // content when style recalc is over and DOM mutation is allowed again. 462 // content when style recalc is over and DOM mutation is allowed again.
463 if (!url.isNull()) { 463 if (!url.isNull()) {
464 Resource* resource = memoryCache()->resourceForURL( 464 Resource* resource = memoryCache()->resourceForURL(
465 url, m_element->document().fetcher()->getCacheIdentifier()); 465 url, m_element->document().fetcher()->getCacheIdentifier());
466 if (resource && !resource->errorOccurred()) 466 if (resource && !resource->errorOccurred())
467 return true; 467 return true;
468 } 468 }
469 return (isHTMLObjectElement(m_element) || isHTMLEmbedElement(m_element) || 469 return (isHTMLObjectElement(m_element) || isHTMLEmbedElement(m_element));
470 url.protocolIsData());
471 } 470 }
472 471
473 void ImageLoader::imageNotifyFinished(ImageResourceContent* resource) { 472 void ImageLoader::imageNotifyFinished(ImageResourceContent* resource) {
474 RESOURCE_LOADING_DVLOG(1) 473 RESOURCE_LOADING_DVLOG(1)
475 << "ImageLoader::imageNotifyFinished " << this 474 << "ImageLoader::imageNotifyFinished " << this
476 << "; m_hasPendingLoadEvent=" << m_hasPendingLoadEvent; 475 << "; m_hasPendingLoadEvent=" << m_hasPendingLoadEvent;
477 476
478 DCHECK(m_failedLoadURL.isEmpty()); 477 DCHECK(m_failedLoadURL.isEmpty());
479 DCHECK_EQ(resource, m_image.get()); 478 DCHECK_EQ(resource, m_image.get());
480 479
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 } 634 }
636 635
637 void ImageLoader::elementDidMoveToNewDocument() { 636 void ImageLoader::elementDidMoveToNewDocument() {
638 if (m_loadDelayCounter) 637 if (m_loadDelayCounter)
639 m_loadDelayCounter->documentChanged(m_element->document()); 638 m_loadDelayCounter->documentChanged(m_element->document());
640 clearFailedLoadURL(); 639 clearFailedLoadURL();
641 setImage(0); 640 setImage(0);
642 } 641 }
643 642
644 } // namespace blink 643 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698