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

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

Issue 655003004: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 9
10 namespace base { 10 namespace base {
(...skipping 13 matching lines...) Expand all
24 } 24 }
25 25
26 // static 26 // static
27 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType( 27 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
28 DiscardableMemoryType type, size_t size) { 28 DiscardableMemoryType type, size_t size) {
29 switch (type) { 29 switch (type) {
30 case DISCARDABLE_MEMORY_TYPE_EMULATED: { 30 case DISCARDABLE_MEMORY_TYPE_EMULATED: {
31 scoped_ptr<internal::DiscardableMemoryEmulated> memory( 31 scoped_ptr<internal::DiscardableMemoryEmulated> memory(
32 new internal::DiscardableMemoryEmulated(size)); 32 new internal::DiscardableMemoryEmulated(size));
33 if (!memory->Initialize()) 33 if (!memory->Initialize())
34 return scoped_ptr<DiscardableMemory>(); 34 return nullptr;
35 35
36 return memory.PassAs<DiscardableMemory>(); 36 return memory.Pass();
37 } 37 }
38 case DISCARDABLE_MEMORY_TYPE_NONE: 38 case DISCARDABLE_MEMORY_TYPE_NONE:
39 case DISCARDABLE_MEMORY_TYPE_ASHMEM: 39 case DISCARDABLE_MEMORY_TYPE_ASHMEM:
40 case DISCARDABLE_MEMORY_TYPE_MAC: 40 case DISCARDABLE_MEMORY_TYPE_MAC:
41 NOTREACHED(); 41 NOTREACHED();
42 return scoped_ptr<DiscardableMemory>(); 42 return nullptr;
43 } 43 }
44 44
45 NOTREACHED(); 45 NOTREACHED();
46 return scoped_ptr<DiscardableMemory>(); 46 return nullptr;
47 } 47 }
48 48
49 // static 49 // static
50 void DiscardableMemory::PurgeForTesting() { 50 void DiscardableMemory::PurgeForTesting() {
51 internal::DiscardableMemoryEmulated::PurgeForTesting(); 51 internal::DiscardableMemoryEmulated::PurgeForTesting();
52 } 52 }
53 53
54 } // namespace base 54 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698