| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef CONTENT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_ | |
| 6 #define CONTENT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_ | |
| 7 | |
| 8 #include <stddef.h> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "third_party/WebKit/public/platform/WebDiscardableMemory.h" | |
| 13 | |
| 14 namespace base { | |
| 15 class DiscardableMemory; | |
| 16 } | |
| 17 | |
| 18 namespace content { | |
| 19 | |
| 20 // Implementation of WebDiscardableMemory that is responsible for allocating | |
| 21 // discardable memory. | |
| 22 class WebDiscardableMemoryImpl : public blink::WebDiscardableMemory { | |
| 23 public: | |
| 24 ~WebDiscardableMemoryImpl() override; | |
| 25 | |
| 26 static scoped_ptr<WebDiscardableMemoryImpl> CreateLockedMemory(size_t size); | |
| 27 | |
| 28 // blink::WebDiscardableMemory: | |
| 29 bool lock() override; | |
| 30 void unlock() override; | |
| 31 void* data() override; | |
| 32 blink::WebMemoryAllocatorDump* createMemoryAllocatorDump( | |
| 33 const blink::WebString& name, | |
| 34 blink::WebProcessMemoryDump* wpmd) const override; | |
| 35 | |
| 36 private: | |
| 37 WebDiscardableMemoryImpl(scoped_ptr<base::DiscardableMemory> memory); | |
| 38 | |
| 39 scoped_ptr<base::DiscardableMemory> discardable_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(WebDiscardableMemoryImpl); | |
| 42 }; | |
| 43 | |
| 44 } // namespace content | |
| 45 | |
| 46 #endif // CONTENT_CHILD_WEB_DISCARDABLE_MEMORY_IMPL_H_ | |
| OLD | NEW |