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

Unified Diff: include/core/SkDiscardableMemory.h

Issue 84783002: SkDiscardableMemory::Factory class (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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: include/core/SkDiscardableMemory.h
diff --git a/src/core/SkDiscardableMemory.h b/include/core/SkDiscardableMemory.h
similarity index 79%
rename from src/core/SkDiscardableMemory.h
rename to include/core/SkDiscardableMemory.h
index e1634eef4f4013a5945f4cb64f67b09c17d16271..f3159fe2af0c46261814b84a65d4ac020216c7b3 100644
--- a/src/core/SkDiscardableMemory.h
+++ b/include/core/SkDiscardableMemory.h
@@ -8,6 +8,7 @@
#ifndef SkDiscardableMemory_DEFINED
#define SkDiscardableMemory_DEFINED
+#include "SkRefCnt.h"
#include "SkTypes.h"
/**
@@ -15,7 +16,6 @@
* embedder.
*/
class SK_API SkDiscardableMemory {
-
public:
/**
* Factory method that creates, initializes and locks an SkDiscardableMemory
@@ -23,6 +23,17 @@ public:
*/
static SkDiscardableMemory* Create(size_t bytes);
+ /**
+ * Factory class that creates, initializes and locks an SkDiscardableMemory
+ * object. If either of these steps fails, a NULL pointer will be returned.
+ */
+ class Factory : public SkRefCnt {
+ public:
+ virtual SkDiscardableMemory* create(size_t bytes) = 0;
+ private:
+ typedef SkRefCnt INHERITED;
+ };
+
/** Must not be called while locked.
*/
virtual ~SkDiscardableMemory() {}
« no previous file with comments | « gyp/core.gypi ('k') | include/lazy/SkImageCache.h » ('j') | include/lazy/SkImageCache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698