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

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

Issue 1256233002: Move data URI image resources to be async loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed some tests but not all Created 5 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 | « Source/core/html/parser/HTMLSrcsetParser.cpp ('k') | Source/web/tests/ActivityLoggerTest.cpp » ('j') | 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 448
449 bool ImageLoader::shouldLoadImmediately(const KURL& url) const 449 bool ImageLoader::shouldLoadImmediately(const KURL& url) const
450 { 450 {
451 // We force any image loads which might require alt content through the asyn chronous path so that we can add the shadow DOM 451 // We force any image loads which might require alt content through the asyn chronous path so that we can add the shadow DOM
452 // for the alt-text content when style recalc is over and DOM mutation is al lowed again. 452 // for the alt-text content when style recalc is over and DOM mutation is al lowed again.
453 if (!url.isNull()) { 453 if (!url.isNull()) {
454 Resource* resource = memoryCache()->resourceForURL(url, m_element->docum ent().fetcher()->getCacheIdentifier()); 454 Resource* resource = memoryCache()->resourceForURL(url, m_element->docum ent().fetcher()->getCacheIdentifier());
455 if (resource && !resource->errorOccurred()) 455 if (resource && !resource->errorOccurred())
456 return true; 456 return true;
457 } 457 }
458 return (m_loadingImageDocument || isHTMLObjectElement(m_element) || isHTMLEm bedElement(m_element) || url.protocolIsData()); 458 return (m_loadingImageDocument || isHTMLObjectElement(m_element) || isHTMLEm bedElement(m_element));
459 } 459 }
460 460
461 void ImageLoader::notifyFinished(Resource* resource) 461 void ImageLoader::notifyFinished(Resource* resource)
462 { 462 {
463 WTF_LOG(Timers, "ImageLoader::notifyFinished %p; m_hasPendingLoadEvent=%d", 463 WTF_LOG(Timers, "ImageLoader::notifyFinished %p; m_hasPendingLoadEvent=%d",
464 this, m_hasPendingLoadEvent); 464 this, m_hasPendingLoadEvent);
465 465
466 ASSERT(m_failedLoadURL.isEmpty()); 466 ASSERT(m_failedLoadURL.isEmpty());
467 ASSERT(resource == m_image.get()); 467 ASSERT(resource == m_image.get());
468 468
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 664
665 void ImageLoader::sourceImageChanged() 665 void ImageLoader::sourceImageChanged()
666 { 666 {
667 for (auto& client : m_clients) { 667 for (auto& client : m_clients) {
668 ImageLoaderClient* handle = client; 668 ImageLoaderClient* handle = client;
669 handle->notifyImageSourceChanged(); 669 handle->notifyImageSourceChanged();
670 } 670 }
671 } 671 }
672 672
673 } // namespace blink 673 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLSrcsetParser.cpp ('k') | Source/web/tests/ActivityLoggerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698