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

Side by Side Diff: base/memory/discardable_memory_allocator.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_ALLOCATOR_H_ 5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_ALLOCATOR_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_ALLOCATOR_H_ 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_ALLOCATOR_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory>
11
10 #include "base/base_export.h" 12 #include "base/base_export.h"
11 #include "base/memory/scoped_ptr.h"
12 13
13 namespace base { 14 namespace base {
14 class DiscardableMemory; 15 class DiscardableMemory;
15 16
16 class BASE_EXPORT DiscardableMemoryAllocator { 17 class BASE_EXPORT DiscardableMemoryAllocator {
17 public: 18 public:
18 // Returns the allocator instance. 19 // Returns the allocator instance.
19 static DiscardableMemoryAllocator* GetInstance(); 20 static DiscardableMemoryAllocator* GetInstance();
20 21
21 // Sets the allocator instance. Can only be called once, e.g. on startup. 22 // Sets the allocator instance. Can only be called once, e.g. on startup.
22 // Ownership of |instance| remains with the caller. 23 // Ownership of |instance| remains with the caller.
23 static void SetInstance(DiscardableMemoryAllocator* allocator); 24 static void SetInstance(DiscardableMemoryAllocator* allocator);
24 25
25 virtual scoped_ptr<DiscardableMemory> AllocateLockedDiscardableMemory( 26 virtual std::unique_ptr<DiscardableMemory> AllocateLockedDiscardableMemory(
26 size_t size) = 0; 27 size_t size) = 0;
27 28
28 protected: 29 protected:
29 virtual ~DiscardableMemoryAllocator() {} 30 virtual ~DiscardableMemoryAllocator() {}
30 }; 31 };
31 32
32 } // namespace base 33 } // namespace base
33 34
34 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_ALLOCATOR_H_ 35 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « base/memory/aligned_memory_unittest.cc ('k') | base/memory/memory_pressure_listener_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698