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

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

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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
« no previous file with comments | « base/memory/discardable_memory_android.cc ('k') | base/memory/discardable_shared_memory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/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_mach.h" 9 #include "base/memory/discardable_memory_mach.h"
10 #include "base/memory/discardable_memory_manager.h" 10 #include "base/memory/discardable_memory_manager.h"
11 #include "base/memory/discardable_memory_shmem.h" 11 #include "base/memory/discardable_memory_shmem.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 // static 16 // static
17 bool DiscardableMemory::ReduceMemoryUsage() { 17 bool DiscardableMemory::ReduceMemoryUsage() {
18 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage(); 18 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage();
19 } 19 }
20 20
21 // static 21 // static
22 void DiscardableMemory::GetSupportedTypes( 22 void DiscardableMemory::GetSupportedTypes(
23 std::vector<DiscardableMemoryType>* types) { 23 std::vector<DiscardableMemoryType>* types) {
24 const DiscardableMemoryType supported_types[] = { 24 const DiscardableMemoryType supported_types[] = {
25 DISCARDABLE_MEMORY_TYPE_SHMEM,
25 DISCARDABLE_MEMORY_TYPE_MACH, 26 DISCARDABLE_MEMORY_TYPE_MACH,
26 DISCARDABLE_MEMORY_TYPE_SHMEM,
27 DISCARDABLE_MEMORY_TYPE_EMULATED 27 DISCARDABLE_MEMORY_TYPE_EMULATED
28 }; 28 };
29 types->assign(supported_types, supported_types + arraysize(supported_types)); 29 types->assign(supported_types, supported_types + arraysize(supported_types));
30 } 30 }
31 31
32 // static 32 // static
33 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType( 33 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
34 DiscardableMemoryType type, size_t size) { 34 DiscardableMemoryType type, size_t size) {
35 switch (type) { 35 switch (type) {
36 case DISCARDABLE_MEMORY_TYPE_MACH: { 36 case DISCARDABLE_MEMORY_TYPE_MACH: {
(...skipping 24 matching lines...) Expand all
61 case DISCARDABLE_MEMORY_TYPE_ASHMEM: 61 case DISCARDABLE_MEMORY_TYPE_ASHMEM:
62 NOTREACHED(); 62 NOTREACHED();
63 return nullptr; 63 return nullptr;
64 } 64 }
65 65
66 NOTREACHED(); 66 NOTREACHED();
67 return nullptr; 67 return nullptr;
68 } 68 }
69 69
70 } // namespace base 70 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_android.cc ('k') | base/memory/discardable_shared_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698