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

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

Issue 1001833005: Update from https://crrev.com/320343 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Supress Created 5 years, 9 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 2014 The Chromium Authors. All rights reserved. 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 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_SHMEM_H_ 5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_H_ 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_H_
7 7
8 #include "base/memory/discardable_memory.h" 8 #include "base/memory/discardable_memory.h"
9 9
10 namespace base { 10 namespace base {
11 class DiscardableMemoryShmemChunk; 11 class DiscardableMemoryShmemChunk;
12 12
13 namespace internal { 13 namespace internal {
14 14
15 class DiscardableMemoryShmem : public DiscardableMemory { 15 class DiscardableMemoryShmem : public DiscardableMemory {
16 public: 16 public:
17 explicit DiscardableMemoryShmem(size_t bytes); 17 explicit DiscardableMemoryShmem(size_t bytes);
18 ~DiscardableMemoryShmem() override; 18 ~DiscardableMemoryShmem() override;
19 19
20 bool Initialize(); 20 bool Initialize();
21 21
22 // Overridden from DiscardableMemory: 22 // Overridden from DiscardableMemory:
23 DiscardableMemoryLockStatus Lock() override; 23 bool Lock() override;
24 void Unlock() override; 24 void Unlock() override;
25 void* Memory() const override; 25 void* Memory() const override;
26 26
27 private: 27 private:
28 const size_t bytes_;
29 scoped_ptr<DiscardableMemoryShmemChunk> chunk_; 28 scoped_ptr<DiscardableMemoryShmemChunk> chunk_;
30 bool is_locked_; 29 bool is_locked_;
31 30
32 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryShmem); 31 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryShmem);
33 }; 32 };
34 33
35 } // namespace internal 34 } // namespace internal
36 } // namespace base 35 } // namespace base
37 36
38 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_H_ 37 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_SHMEM_H_
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_manager_unittest.cc ('k') | base/memory/discardable_memory_shmem.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698