Index: Source/core/loader/ImageLoader.h |
diff --git a/Source/core/loader/ImageLoader.h b/Source/core/loader/ImageLoader.h |
index f06089e2e5ae62f7eea6a4e8c991302d79b64284..75bf6d01f702d755fd6194d7b5371b9249f3f645 100644 |
--- a/Source/core/loader/ImageLoader.h |
+++ b/Source/core/loader/ImageLoader.h |
@@ -26,10 +26,22 @@ |
#include "core/loader/cache/CachedImage.h" |
#include "core/loader/cache/CachedImageClient.h" |
#include "core/loader/cache/CachedResourceHandle.h" |
+#include "wtf/HashSet.h" |
#include "wtf/text/AtomicString.h" |
namespace WebCore { |
+class ImageLoaderClient { |
+public: |
+ virtual void notifyImageSourceChanged() = 0; |
+ |
+ // Notifies whether the observed CachedImage should have higher priority in the decoded resources cache. |
+ virtual bool isHighPriorityImageLoaderClient() = 0; |
Justin Novosad
2013/07/29 15:29:43
the "ImageLoaderClient" part of themname does not
|
+ |
+protected: |
+ ImageLoaderClient() { } |
+}; |
+ |
class Element; |
class ImageLoader; |
class RenderImageResource; |
@@ -69,6 +81,9 @@ public: |
static void dispatchPendingLoadEvents(); |
static void dispatchPendingErrorEvents(); |
+ void addClient(ImageLoaderClient*); |
+ void removeClient(ImageLoaderClient*); |
+ |
protected: |
virtual void notifyFinished(CachedResource*); |
@@ -86,12 +101,14 @@ private: |
void updateRenderer(); |
void setImageWithoutConsideringPendingLoadEvent(CachedImage*); |
+ void sourceImageChanged(); |
void clearFailedLoadURL(); |
void timerFired(Timer<ImageLoader>*); |
Element* m_element; |
CachedResourceHandle<CachedImage> m_image; |
+ HashSet<ImageLoaderClient*> m_clients; |
Timer<ImageLoader> m_derefElementTimer; |
AtomicString m_failedLoadURL; |
bool m_hasPendingBeforeLoadEvent : 1; |
@@ -100,6 +117,7 @@ private: |
bool m_imageComplete : 1; |
bool m_loadManually : 1; |
bool m_elementIsProtected : 1; |
+ unsigned m_highPriorityClientCount; |
}; |
} |