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

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 drawImage out of bounds src rect. Created 7 years, 5 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
Index: Source/core/loader/ImageLoader.h
diff --git a/Source/core/loader/ImageLoader.h b/Source/core/loader/ImageLoader.h
index f06089e2e5ae62f7eea6a4e8c991302d79b64284..92f450981942022964f173f91a189da70e25b2d3 100644
--- a/Source/core/loader/ImageLoader.h
+++ b/Source/core/loader/ImageLoader.h
@@ -26,10 +26,19 @@
#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() { }
+
+protected:
+ ImageLoaderClient() { }
+};
+
class Element;
class ImageLoader;
class RenderImageResource;
@@ -69,6 +78,9 @@ public:
static void dispatchPendingLoadEvents();
static void dispatchPendingErrorEvents();
+ void addClient(ImageLoaderClient* client) { m_clients.add(client); }
Stephen White 2013/07/25 18:01:07 I'm not sure if the ImageLoader is really the righ
+ void removeClient(ImageLoaderClient* client) { m_clients.remove(client); }
+
protected:
virtual void notifyFinished(CachedResource*);
@@ -86,12 +98,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;

Powered by Google App Engine
This is Rietveld 408576698