Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: base/memory/discardable_memory_linux.cc

Issue 195863005: Use DiscardableMemoryManager on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix DiscardableMemoryAshmem + enable unit test on Android that exposes the bug Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698