Chromium Code Reviews

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

Issue 952893003: Update from https://crrev.com/317530 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix gn for nacl Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « base/memory/discardable_memory_linux.cc ('k') | base/memory/discardable_memory_win.cc » ('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_MACH, 25 DISCARDABLE_MEMORY_TYPE_MACH,
26 DISCARDABLE_MEMORY_TYPE_EMULATED, 26 DISCARDABLE_MEMORY_TYPE_SHMEM,
27 DISCARDABLE_MEMORY_TYPE_SHMEM 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: {
37 scoped_ptr<internal::DiscardableMemoryMach> memory( 37 scoped_ptr<internal::DiscardableMemoryMach> memory(
(...skipping 23 matching lines...)
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_linux.cc ('k') | base/memory/discardable_memory_win.cc » ('j') | no next file with comments »

Powered by Google App Engine