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

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

Issue 793443003: Re-land: base: Enable browser-wide discardable memory on Linux, CrOS and Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@free-list
Patch Set: Created 6 years 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_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"
(...skipping 10 matching lines...) Expand all
21 // static 21 // static
22 bool DiscardableMemory::ReduceMemoryUsage() { 22 bool DiscardableMemory::ReduceMemoryUsage() {
23 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage(); 23 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage();
24 } 24 }
25 25
26 // static 26 // static
27 void DiscardableMemory::GetSupportedTypes( 27 void DiscardableMemory::GetSupportedTypes(
28 std::vector<DiscardableMemoryType>* types) { 28 std::vector<DiscardableMemoryType>* types) {
29 const DiscardableMemoryType supported_types[] = { 29 const DiscardableMemoryType supported_types[] = {
30 DISCARDABLE_MEMORY_TYPE_MACH, 30 DISCARDABLE_MEMORY_TYPE_MACH,
31 DISCARDABLE_MEMORY_TYPE_EMULATED, 31 DISCARDABLE_MEMORY_TYPE_SHMEM,
32 DISCARDABLE_MEMORY_TYPE_SHMEM 32 DISCARDABLE_MEMORY_TYPE_EMULATED
33 }; 33 };
34 types->assign(supported_types, supported_types + arraysize(supported_types)); 34 types->assign(supported_types, supported_types + arraysize(supported_types));
35 } 35 }
36 36
37 // static 37 // static
38 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType( 38 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
39 DiscardableMemoryType type, size_t size) { 39 DiscardableMemoryType type, size_t size) {
40 switch (type) { 40 switch (type) {
41 case DISCARDABLE_MEMORY_TYPE_MACH: { 41 case DISCARDABLE_MEMORY_TYPE_MACH: {
42 scoped_ptr<internal::DiscardableMemoryMach> memory( 42 scoped_ptr<internal::DiscardableMemoryMach> memory(
(...skipping 30 matching lines...) Expand all
73 } 73 }
74 74
75 // static 75 // static
76 void DiscardableMemory::PurgeForTesting() { 76 void DiscardableMemory::PurgeForTesting() {
77 internal::DiscardableMemoryMach::PurgeForTesting(); 77 internal::DiscardableMemoryMach::PurgeForTesting();
78 internal::DiscardableMemoryEmulated::PurgeForTesting(); 78 internal::DiscardableMemoryEmulated::PurgeForTesting();
79 internal::DiscardableMemoryShmem::PurgeForTesting(); 79 internal::DiscardableMemoryShmem::PurgeForTesting();
80 } 80 }
81 81
82 } // namespace base 82 } // 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
This is Rietveld 408576698