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_malloc.h" | 9 #include "base/memory/discardable_memory_malloc.h" |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 return memory.PassAs<DiscardableMemory>(); | 55 return memory.PassAs<DiscardableMemory>(); |
56 } | 56 } |
57 } | 57 } |
58 | 58 |
59 NOTREACHED(); | 59 NOTREACHED(); |
60 return scoped_ptr<DiscardableMemory>(); | 60 return scoped_ptr<DiscardableMemory>(); |
61 } | 61 } |
62 | 62 |
63 // static | 63 // static |
64 bool DiscardableMemory::PurgeForTestingSupported() { | 64 bool DiscardableMemory::PurgeForTestingSupported(DiscardableMemoryType type) { |
65 return true; | 65 switch (type) { |
| 66 case DISCARDABLE_MEMORY_TYPE_EMULATED: |
| 67 return true; |
| 68 default: |
| 69 return false; |
| 70 } |
66 } | 71 } |
67 | 72 |
68 // static | 73 // static |
69 void DiscardableMemory::PurgeForTesting() { | 74 void DiscardableMemory::PurgeForTesting(DiscardableMemoryType type) { |
70 internal::DiscardableMemoryEmulated::PurgeForTesting(); | 75 switch (type) { |
| 76 case DISCARDABLE_MEMORY_TYPE_EMULATED: |
| 77 internal::DiscardableMemoryEmulated::PurgeForTesting(); |
| 78 return; |
| 79 default: |
| 80 NOTREACHED(); |
| 81 } |
71 } | 82 } |
72 | 83 |
73 } // namespace base | 84 } // namespace base |
OLD | NEW |