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

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

Issue 900613004: Update {virtual,override,final} to follow C++11 style in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/android/trace_event_binding.cc ('k') | base/message_loop/message_pump_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ASHMEM_H_ 5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_
7 7
8 #include "base/memory/discardable_memory.h" 8 #include "base/memory/discardable_memory.h"
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/discardable_memory_manager.h" 11 #include "base/memory/discardable_memory_manager.h"
12 12
13 namespace base { 13 namespace base {
14 namespace internal { 14 namespace internal {
15 15
16 class DiscardableAshmemChunk; 16 class DiscardableAshmemChunk;
17 class DiscardableMemoryAshmemAllocator; 17 class DiscardableMemoryAshmemAllocator;
18 class DiscardableMemoryManager; 18 class DiscardableMemoryManager;
19 19
20 class DiscardableMemoryAshmem 20 class DiscardableMemoryAshmem
21 : public DiscardableMemory, 21 : public DiscardableMemory,
22 public internal::DiscardableMemoryManagerAllocation { 22 public internal::DiscardableMemoryManagerAllocation {
23 public: 23 public:
24 explicit DiscardableMemoryAshmem(size_t bytes, 24 explicit DiscardableMemoryAshmem(size_t bytes,
25 DiscardableMemoryAshmemAllocator* allocator, 25 DiscardableMemoryAshmemAllocator* allocator,
26 DiscardableMemoryManager* manager); 26 DiscardableMemoryManager* manager);
27 27
28 virtual ~DiscardableMemoryAshmem(); 28 ~DiscardableMemoryAshmem() override;
29 29
30 bool Initialize(); 30 bool Initialize();
31 31
32 // Overridden from DiscardableMemory: 32 // Overridden from DiscardableMemory:
33 virtual DiscardableMemoryLockStatus Lock() override; 33 DiscardableMemoryLockStatus Lock() override;
34 virtual void Unlock() override; 34 void Unlock() override;
35 virtual void* Memory() const override; 35 void* Memory() const override;
36 36
37 // Overridden from internal::DiscardableMemoryManagerAllocation: 37 // Overridden from internal::DiscardableMemoryManagerAllocation:
38 virtual bool AllocateAndAcquireLock() override; 38 bool AllocateAndAcquireLock() override;
39 virtual void ReleaseLock() override; 39 void ReleaseLock() override;
40 virtual void Purge() override; 40 void Purge() override;
41 virtual bool IsMemoryResident() const override; 41 bool IsMemoryResident() const override;
42 42
43 private: 43 private:
44 const size_t bytes_; 44 const size_t bytes_;
45 DiscardableMemoryAshmemAllocator* const allocator_; 45 DiscardableMemoryAshmemAllocator* const allocator_;
46 DiscardableMemoryManager* const manager_; 46 DiscardableMemoryManager* const manager_;
47 bool is_locked_; 47 bool is_locked_;
48 scoped_ptr<DiscardableAshmemChunk> ashmem_chunk_; 48 scoped_ptr<DiscardableAshmemChunk> ashmem_chunk_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAshmem); 50 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAshmem);
51 }; 51 };
52 52
53 } // namespace internal 53 } // namespace internal
54 } // namespace base 54 } // namespace base
55 55
56 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_ 56 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_ASHMEM_H_
OLDNEW
« no previous file with comments | « base/android/trace_event_binding.cc ('k') | base/message_loop/message_pump_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698