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

Unified Diff: webkit/child/web_discardable_memory_impl.h

Issue 24988003: Refactor DiscardableMemory for the upcoming DiscardableMemoryAllocator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux clang build Created 7 years, 2 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 | « skia/ext/SkDiscardableMemory_chrome.cc ('k') | webkit/child/web_discardable_memory_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/child/web_discardable_memory_impl.h
diff --git a/webkit/child/web_discardable_memory_impl.h b/webkit/child/web_discardable_memory_impl.h
index f2ad3287a010c251ac33d428ece3bec91391e6d3..82de1c4b7c9c33f425ce65840184d03f1f78c59a 100644
--- a/webkit/child/web_discardable_memory_impl.h
+++ b/webkit/child/web_discardable_memory_impl.h
@@ -5,6 +5,7 @@
#ifndef WEBKIT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_
#define WEBKIT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_
+#include "base/basictypes.h"
#include "base/memory/discardable_memory.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/WebKit/public/platform/WebDiscardableMemory.h"
@@ -21,21 +22,20 @@ namespace webkit_glue {
class WEBKIT_CHILD_EXPORT WebDiscardableMemoryImpl
: NON_EXPORTED_BASE(public WebKit::WebDiscardableMemory) {
public:
- WebDiscardableMemoryImpl();
virtual ~WebDiscardableMemoryImpl();
- // WebKit::WebDiscardableMemory implementation.
+ static scoped_ptr<WebDiscardableMemoryImpl> CreateLockedMemory(size_t size);
+
+ // WebKit::WebDiscardableMemory:
virtual bool lock();
virtual void unlock();
virtual void* data();
- // Initialize the WebDiscardableMemoryImpl object and lock the memory.
- // Returns true on success. No memory is allocated if this call returns
- // false. This call should only be called once.
- bool InitializeAndLock(size_t size);
-
private:
+ WebDiscardableMemoryImpl(scoped_ptr<base::DiscardableMemory> memory);
+
scoped_ptr<base::DiscardableMemory> discardable_;
+
DISALLOW_COPY_AND_ASSIGN(WebDiscardableMemoryImpl);
};
« no previous file with comments | « skia/ext/SkDiscardableMemory_chrome.cc ('k') | webkit/child/web_discardable_memory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698