Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / child / web_discardable_memory_impl.h
blob7eaefb4dadf9dc2af0efdae6b9cd1424b7766304
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"
13 namespace blink {
14 class WebDiscardableMemory;
17 namespace content {
19 // Implementation of WebDiscardableMemory that is responsible for allocating
20 // discardable memory.
21 class WebDiscardableMemoryImpl : public blink::WebDiscardableMemory {
22 public:
23 virtual ~WebDiscardableMemoryImpl();
25 static scoped_ptr<WebDiscardableMemoryImpl> CreateLockedMemory(size_t size);
27 // blink::WebDiscardableMemory:
28 virtual bool lock();
29 virtual void unlock();
30 virtual void* data();
32 private:
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_