1 // Copyright 2014 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 CONTENT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_
6 #define CONTENT_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"
14 class WebDiscardableMemory
;
19 // Implementation of WebDiscardableMemory that is responsible for allocating
20 // discardable memory.
21 class WebDiscardableMemoryImpl
: public blink::WebDiscardableMemory
{
23 virtual ~WebDiscardableMemoryImpl();
25 static scoped_ptr
<WebDiscardableMemoryImpl
> CreateLockedMemory(size_t size
);
27 // blink::WebDiscardableMemory:
29 virtual void unlock();
33 WebDiscardableMemoryImpl(scoped_ptr
<base::DiscardableMemory
> memory
);
35 scoped_ptr
<base::DiscardableMemory
> discardable_
;
37 DISALLOW_COPY_AND_ASSIGN(WebDiscardableMemoryImpl
);
40 } // namespace content
42 #endif // CONTENT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_