1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef WEBKIT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_
6 #define WEBKIT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_
8 #include "base/basictypes.h"
9 #include "base/memory/discardable_memory.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h"
12 #include "webkit/child/webkit_child_export.h"
15 class WebDiscardableMemory;
18 namespace webkit_glue {
20 // Implementation of WebDiscardableMemory that is responsible for allocating
21 // discardable memory.
22 class WEBKIT_CHILD_EXPORT WebDiscardableMemoryImpl
23 : NON_EXPORTED_BASE(public WebKit::WebDiscardableMemory) {
25 virtual ~WebDiscardableMemoryImpl();
27 static scoped_ptr<WebDiscardableMemoryImpl> CreateLockedMemory(size_t size);
29 // WebKit::WebDiscardableMemory:
31 virtual void unlock();
35 WebDiscardableMemoryImpl(scoped_ptr<base::DiscardableMemory> memory);
37 scoped_ptr<base::DiscardableMemory> discardable_;
39 DISALLOW_COPY_AND_ASSIGN(WebDiscardableMemoryImpl);
42 } // namespace webkit_glue
44 #endif // WEBKIT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_