OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/memory/discardable_memory.h" | 5 #include "base/memory/discardable_memory.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 // static | 46 // static |
47 bool DiscardableMemory::ReduceMemoryUsage() { | 47 bool DiscardableMemory::ReduceMemoryUsage() { |
48 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage(); | 48 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage(); |
49 } | 49 } |
50 | 50 |
51 // static | 51 // static |
52 void DiscardableMemory::GetSupportedTypes( | 52 void DiscardableMemory::GetSupportedTypes( |
53 std::vector<DiscardableMemoryType>* types) { | 53 std::vector<DiscardableMemoryType>* types) { |
54 const DiscardableMemoryType supported_types[] = { | 54 const DiscardableMemoryType supported_types[] = { |
| 55 DISCARDABLE_MEMORY_TYPE_SHMEM, |
55 DISCARDABLE_MEMORY_TYPE_ASHMEM, | 56 DISCARDABLE_MEMORY_TYPE_ASHMEM, |
56 DISCARDABLE_MEMORY_TYPE_SHMEM, | |
57 DISCARDABLE_MEMORY_TYPE_EMULATED | 57 DISCARDABLE_MEMORY_TYPE_EMULATED |
58 }; | 58 }; |
59 types->assign(supported_types, supported_types + arraysize(supported_types)); | 59 types->assign(supported_types, supported_types + arraysize(supported_types)); |
60 } | 60 } |
61 | 61 |
62 // static | 62 // static |
63 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType( | 63 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType( |
64 DiscardableMemoryType type, size_t size) { | 64 DiscardableMemoryType type, size_t size) { |
65 switch (type) { | 65 switch (type) { |
66 case DISCARDABLE_MEMORY_TYPE_ASHMEM: { | 66 case DISCARDABLE_MEMORY_TYPE_ASHMEM: { |
(...skipping 26 matching lines...) Expand all Loading... |
93 case DISCARDABLE_MEMORY_TYPE_MACH: | 93 case DISCARDABLE_MEMORY_TYPE_MACH: |
94 NOTREACHED(); | 94 NOTREACHED(); |
95 return nullptr; | 95 return nullptr; |
96 } | 96 } |
97 | 97 |
98 NOTREACHED(); | 98 NOTREACHED(); |
99 return nullptr; | 99 return nullptr; |
100 } | 100 } |
101 | 101 |
102 } // namespace base | 102 } // namespace base |
OLD | NEW |