| 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 "base/memory/discardable_memory.h" | 5 #include "base/memory/discardable_memory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/discardable_memory_emulated.h" | 8 #include "base/memory/discardable_memory_emulated.h" |
| 9 #include "base/memory/discardable_memory_shmem.h" | 9 #include "base/memory/discardable_memory_shmem.h" |
| 10 | 10 |
| 11 namespace base { | 11 namespace base { |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 void DiscardableMemory::ReleaseFreeMemory() { | |
| 15 internal::DiscardableMemoryShmem::ReleaseFreeMemory(); | |
| 16 } | |
| 17 | |
| 18 // static | |
| 19 bool DiscardableMemory::ReduceMemoryUsage() { | 14 bool DiscardableMemory::ReduceMemoryUsage() { |
| 20 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage(); | 15 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage(); |
| 21 } | 16 } |
| 22 | 17 |
| 23 // static | 18 // static |
| 24 void DiscardableMemory::GetSupportedTypes( | 19 void DiscardableMemory::GetSupportedTypes( |
| 25 std::vector<DiscardableMemoryType>* types) { | 20 std::vector<DiscardableMemoryType>* types) { |
| 26 const DiscardableMemoryType supported_types[] = { | 21 const DiscardableMemoryType supported_types[] = { |
| 27 DISCARDABLE_MEMORY_TYPE_EMULATED, | 22 DISCARDABLE_MEMORY_TYPE_EMULATED, |
| 28 DISCARDABLE_MEMORY_TYPE_SHMEM | 23 DISCARDABLE_MEMORY_TYPE_SHMEM |
| (...skipping 25 matching lines...) Expand all Loading... |
| 54 case DISCARDABLE_MEMORY_TYPE_ASHMEM: | 49 case DISCARDABLE_MEMORY_TYPE_ASHMEM: |
| 55 case DISCARDABLE_MEMORY_TYPE_MACH: | 50 case DISCARDABLE_MEMORY_TYPE_MACH: |
| 56 NOTREACHED(); | 51 NOTREACHED(); |
| 57 return nullptr; | 52 return nullptr; |
| 58 } | 53 } |
| 59 | 54 |
| 60 NOTREACHED(); | 55 NOTREACHED(); |
| 61 return nullptr; | 56 return nullptr; |
| 62 } | 57 } |
| 63 | 58 |
| 64 // static | |
| 65 void DiscardableMemory::PurgeForTesting() { | |
| 66 internal::DiscardableMemoryEmulated::PurgeForTesting(); | |
| 67 internal::DiscardableMemoryShmem::PurgeForTesting(); | |
| 68 } | |
| 69 | |
| 70 } // namespace base | 59 } // namespace base |
| OLD | NEW |