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

Side by Side Diff: base/memory/discardable_memory_mach.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
« no previous file with comments | « base/memory/discardable_memory_mac.cc ('k') | base/memory/discardable_memory_mach.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_MACH_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_MACH_H_
7
8 #include "base/memory/discardable_memory.h"
9
10 #include "base/mac/scoped_mach_vm.h"
11 #include "base/memory/discardable_memory_manager.h"
12
13 namespace base {
14 namespace internal {
15
16 class DiscardableMemoryMach
17 : public DiscardableMemory,
18 public internal::DiscardableMemoryManagerAllocation {
19 public:
20 explicit DiscardableMemoryMach(size_t bytes);
21 ~DiscardableMemoryMach() override;
22
23 bool Initialize();
24
25 // Overridden from DiscardableMemory:
26 DiscardableMemoryLockStatus Lock() override;
27 void Unlock() override;
28 void* Memory() const override;
29
30 // Overridden from internal::DiscardableMemoryManagerAllocation:
31 bool AllocateAndAcquireLock() override;
32 void ReleaseLock() override;
33 void Purge() override;
34
35 private:
36 mac::ScopedMachVM memory_;
37 const size_t bytes_;
38 bool is_locked_;
39
40 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryMach);
41 };
42
43 } // namespace internal
44 } // namespace base
45
46 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_MACH_H_
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_mac.cc ('k') | base/memory/discardable_memory_mach.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698