Index: Source/core/loader/ImageLoader.cpp |
diff --git a/Source/core/loader/ImageLoader.cpp b/Source/core/loader/ImageLoader.cpp |
index f177dd996f833c9b8ce095731bff8715c335309c..e18333b930c7e7d03f9670adeb637e1bfc993ea1 100644 |
--- a/Source/core/loader/ImageLoader.cpp |
+++ b/Source/core/loader/ImageLoader.cpp |
@@ -28,6 +28,7 @@ |
#include "core/events/EventSender.h" |
#include "core/fetch/CrossOriginAccessControl.h" |
#include "core/fetch/FetchRequest.h" |
+#include "core/fetch/MemoryCache.h" |
#include "core/fetch/ResourceFetcher.h" |
#include "core/html/HTMLObjectElement.h" |
#include "core/html/parser/HTMLParserIdioms.h" |
@@ -223,6 +224,24 @@ void ImageLoader::updateFromElementIgnoringPreviousError() |
updateFromElement(); |
} |
+bool ImageLoader::shouldLoadImmediately() const |
+{ |
+ if (m_loadManually) |
+ return true; |
+ |
+ AtomicString attr = m_element->imageSourceURL(); |
+ if (attr.isNull() || stripLeadingAndTrailingHTMLSpaces(attr).isEmpty()) { |
+ return true; |
+ } |
+ |
+ KURL url = m_element->document().completeURL(sourceURI(attr)); |
+ if (url.protocolIsData()) |
+ return true; |
abarth-chromium
2014/04/01 23:57:14
Why are data URLs special?
|
+ if (memoryCache()->resourceForURL(url)) |
+ return true; |
+ return false; |
+} |
+ |
void ImageLoader::notifyFinished(Resource* resource) |
{ |
ASSERT(m_failedLoadURL.isEmpty()); |