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

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

Issue 336273003: base: Add soft memory limit to DiscardableMemoryManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac build Created 6 years, 5 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
11 namespace base { 11 namespace base {
12 12
13 // static 13 // static
14 void DiscardableMemory::RegisterMemoryPressureListeners() { 14 void DiscardableMemory::RegisterMemoryPressureListeners() {
15 internal::DiscardableMemoryEmulated::RegisterMemoryPressureListeners(); 15 internal::DiscardableMemoryEmulated::RegisterMemoryPressureListeners();
16 } 16 }
17 17
18 // static 18 // static
19 void DiscardableMemory::UnregisterMemoryPressureListeners() { 19 void DiscardableMemory::UnregisterMemoryPressureListeners() {
20 internal::DiscardableMemoryEmulated::UnregisterMemoryPressureListeners(); 20 internal::DiscardableMemoryEmulated::UnregisterMemoryPressureListeners();
21 } 21 }
22 22
23 // static 23 // static
24 bool DiscardableMemory::ReduceMemoryUsage() {
25 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage();
26 }
27
28 // static
24 void DiscardableMemory::GetSupportedTypes( 29 void DiscardableMemory::GetSupportedTypes(
25 std::vector<DiscardableMemoryType>* types) { 30 std::vector<DiscardableMemoryType>* types) {
26 const DiscardableMemoryType supported_types[] = { 31 const DiscardableMemoryType supported_types[] = {
27 DISCARDABLE_MEMORY_TYPE_EMULATED, 32 DISCARDABLE_MEMORY_TYPE_EMULATED,
28 DISCARDABLE_MEMORY_TYPE_MALLOC 33 DISCARDABLE_MEMORY_TYPE_MALLOC
29 }; 34 };
30 types->assign(supported_types, supported_types + arraysize(supported_types)); 35 types->assign(supported_types, supported_types + arraysize(supported_types));
31 } 36 }
32 37
33 // static 38 // static
(...skipping 25 matching lines...) Expand all
59 NOTREACHED(); 64 NOTREACHED();
60 return scoped_ptr<DiscardableMemory>(); 65 return scoped_ptr<DiscardableMemory>();
61 } 66 }
62 67
63 // static 68 // static
64 void DiscardableMemory::PurgeForTesting() { 69 void DiscardableMemory::PurgeForTesting() {
65 internal::DiscardableMemoryEmulated::PurgeForTesting(); 70 internal::DiscardableMemoryEmulated::PurgeForTesting();
66 } 71 }
67 72
68 } // namespace base 73 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_manager_unittest.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698