OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "skia/ext/SkDiscardableMemory_chrome.h" | 5 #include "skia/ext/SkDiscardableMemory_chrome.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <utility> | 9 #include <utility> |
8 | 10 |
9 #include "base/memory/discardable_memory.h" | 11 #include "base/memory/discardable_memory.h" |
10 #include "base/memory/discardable_memory_allocator.h" | 12 #include "base/memory/discardable_memory_allocator.h" |
11 | 13 |
12 SkDiscardableMemoryChrome::~SkDiscardableMemoryChrome() {} | 14 SkDiscardableMemoryChrome::~SkDiscardableMemoryChrome() {} |
13 | 15 |
14 bool SkDiscardableMemoryChrome::lock() { | 16 bool SkDiscardableMemoryChrome::lock() { |
15 return discardable_->Lock(); | 17 return discardable_->Lock(); |
16 } | 18 } |
(...skipping 15 matching lines...) Expand all Loading... |
32 const char* name, | 34 const char* name, |
33 base::trace_event::ProcessMemoryDump* pmd) const { | 35 base::trace_event::ProcessMemoryDump* pmd) const { |
34 return discardable_->CreateMemoryAllocatorDump(name, pmd); | 36 return discardable_->CreateMemoryAllocatorDump(name, pmd); |
35 } | 37 } |
36 | 38 |
37 SkDiscardableMemory* SkDiscardableMemory::Create(size_t bytes) { | 39 SkDiscardableMemory* SkDiscardableMemory::Create(size_t bytes) { |
38 return new SkDiscardableMemoryChrome( | 40 return new SkDiscardableMemoryChrome( |
39 base::DiscardableMemoryAllocator::GetInstance() | 41 base::DiscardableMemoryAllocator::GetInstance() |
40 ->AllocateLockedDiscardableMemory(bytes)); | 42 ->AllocateLockedDiscardableMemory(bytes)); |
41 } | 43 } |
OLD | NEW |