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

Unified Diff: Source/core/loader/ImageLoader.h

Issue 19393004: Allow eviction of ImageBitmaps that are created from ImageElements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix for assertion failure. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/ImageLoader.h
diff --git a/Source/core/loader/ImageLoader.h b/Source/core/loader/ImageLoader.h
index 86dddb3b790e355db3e4c97ffa37af21c05d50cc..26b3d0bf348a5dd0d8c79789d8278a45a3cd3945 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/ResourcePtr.h"
+#include "wtf/HashSet.h"
#include "wtf/text/AtomicString.h"
namespace WebCore {
+class ImageLoaderClient {
+public:
+ virtual void notifyImageSourceChanged() = 0;
+
+ // Determines whether the observed CachedImage should have higher priority in the decoded resources cache.
+ virtual bool requestsHighLiveResourceCachePriority() { return false; }
+
+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(Resource*);
@@ -86,12 +101,14 @@ private:
void updateRenderer();
void setImageWithoutConsideringPendingLoadEvent(CachedImage*);
+ void sourceImageChanged();
void clearFailedLoadURL();
void timerFired(Timer<ImageLoader>*);
Element* m_element;
ResourcePtr<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;
};
}
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.cpp ('k') | Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698