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

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

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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_mac.cc ('k') | base/memory/scoped_ptr_unittest.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 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_shmem.h" 9 #include "base/memory/discardable_memory_shmem.h"
10 10
11 namespace base { 11 namespace base {
12 12
13 // static 13 // static
14 bool DiscardableMemory::ReduceMemoryUsage() { 14 bool DiscardableMemory::ReduceMemoryUsage() {
15 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage(); 15 return internal::DiscardableMemoryEmulated::ReduceMemoryUsage();
16 } 16 }
17 17
18 // static 18 // static
19 void DiscardableMemory::GetSupportedTypes( 19 void DiscardableMemory::GetSupportedTypes(
20 std::vector<DiscardableMemoryType>* types) { 20 std::vector<DiscardableMemoryType>* types) {
21 const DiscardableMemoryType supported_types[] = { 21 const DiscardableMemoryType supported_types[] = {
22 DISCARDABLE_MEMORY_TYPE_SHMEM, 22 DISCARDABLE_MEMORY_TYPE_EMULATED,
23 DISCARDABLE_MEMORY_TYPE_EMULATED 23 DISCARDABLE_MEMORY_TYPE_SHMEM
24 }; 24 };
25 types->assign(supported_types, supported_types + arraysize(supported_types)); 25 types->assign(supported_types, supported_types + arraysize(supported_types));
26 } 26 }
27 27
28 // static 28 // static
29 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType( 29 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
30 DiscardableMemoryType type, size_t size) { 30 DiscardableMemoryType type, size_t size) {
31 switch (type) { 31 switch (type) {
32 case DISCARDABLE_MEMORY_TYPE_EMULATED: { 32 case DISCARDABLE_MEMORY_TYPE_EMULATED: {
33 scoped_ptr<internal::DiscardableMemoryEmulated> memory( 33 scoped_ptr<internal::DiscardableMemoryEmulated> memory(
(...skipping 16 matching lines...) Expand all
50 case DISCARDABLE_MEMORY_TYPE_MACH: 50 case DISCARDABLE_MEMORY_TYPE_MACH:
51 NOTREACHED(); 51 NOTREACHED();
52 return nullptr; 52 return nullptr;
53 } 53 }
54 54
55 NOTREACHED(); 55 NOTREACHED();
56 return nullptr; 56 return nullptr;
57 } 57 }
58 58
59 } // namespace base 59 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_mac.cc ('k') | base/memory/scoped_ptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698