Index: Source/wtf/DiscardableMemory.h |
diff --git a/public/platform/WebDiscardableMemory.h b/Source/wtf/DiscardableMemory.h |
similarity index 87% |
copy from public/platform/WebDiscardableMemory.h |
copy to Source/wtf/DiscardableMemory.h |
index 0cdcfe383859b18f11da4db7a170b3fe5ea29879..217034d7ab97ac41dbe0a952ec6baa329fa76444 100644 |
--- a/public/platform/WebDiscardableMemory.h |
+++ b/Source/wtf/DiscardableMemory.h |
@@ -23,16 +23,16 @@ |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef WebDiscardableMemory_h |
-#define WebDiscardableMemory_h |
+#ifndef WTF_DiscardableMemory_h |
+#define WTF_DiscardableMemory_h |
-namespace blink { |
+namespace WTF { |
// A memory allocation that can be automatically discarded by the operating |
// system under memory pressure. |
// |
// Discardable usage is typically: |
-// WebDiscardableMemory* mem = allocateAndLockedDiscardableMemory(1024*1024); |
+// DiscardableMemory* mem = WTFPlatform::getInstance()->allocateAndLockedDiscardableMemory(1024*1024); |
// void* data = mem->data(); |
// memset(data, 3, 1024*1024); |
// mem->unlock(); |
@@ -46,17 +46,17 @@ namespace blink { |
// ... use mem->data() as much as you want |
// mem->unlock(); |
// |
-class WebDiscardableMemory { |
+class DiscardableMemory { |
public: |
// Must not be called while locked. |
- virtual ~WebDiscardableMemory() { } |
+ virtual ~DiscardableMemory() { } |
// Locks the memory, prevent it from being discarded. Once locked. you may |
// obtain a pointer to that memory using the data() method. |
// |
// lock() may return false, indicating that the underlying memory was |
- // discarded and that the lock failed. In this case, the |
- // WebDiscardableMemory is effectively dead. |
+ // discarded and that the lock failed. In this case, the DiscardableMemory |
+ // is effectively dead. |
// |
// Nested calls to lock are not allowed. |
virtual bool lock() = 0; |
@@ -70,6 +70,6 @@ public: |
virtual void unlock() = 0; |
}; |
-} // namespace blink |
+} // namespace WTF |
#endif |