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

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

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_ALLOCATOR_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_ALLOCATOR_H_
7
8 #include "base/base_export.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace base {
12 class DiscardableSharedMemory;
13
14 class BASE_EXPORT DiscardableMemoryShmemAllocator {
15 public:
16 // Returns the allocator instance.
17 static DiscardableMemoryShmemAllocator* GetInstance();
18
19 // Sets the allocator instance. Can only be called once, e.g. on startup.
20 // Ownership of |instance| remains with the caller.
21 static void SetInstance(DiscardableMemoryShmemAllocator* allocator);
22
23 virtual scoped_ptr<DiscardableSharedMemory>
24 AllocateLockedDiscardableSharedMemory(size_t size) = 0;
25
26 protected:
27 virtual ~DiscardableMemoryShmemAllocator() {}
28 };
29
30 } // namespace base
31
32 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_shmem.cc ('k') | base/memory/discardable_memory_shmem_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698