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

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

Issue 114923005: base: Discardable memory types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add switches::kUseDiscardableMemory to kForwardSwitches Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « base/memory/discardable_memory_android.cc ('k') | base/memory/discardable_memory_emulated.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_EMULATED_H_ 5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_ 6 #define BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_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 namespace internal { 11 namespace internal {
12 12
13 class DiscardableMemoryEmulated : public DiscardableMemory { 13 class DiscardableMemoryEmulated : public DiscardableMemory {
14 public: 14 public:
15 explicit DiscardableMemoryEmulated(size_t size); 15 explicit DiscardableMemoryEmulated(size_t size);
16 virtual ~DiscardableMemoryEmulated(); 16 virtual ~DiscardableMemoryEmulated();
17 17
18 static void PurgeForTesting(); 18 static void PurgeForTesting();
19 19
20 bool Initialize(); 20 bool Initialize();
21 21
22 // Overridden from DiscardableMemory: 22 // Overridden from DiscardableMemory:
23 virtual LockDiscardableMemoryStatus Lock() OVERRIDE; 23 virtual DiscardableMemoryLockStatus Lock() OVERRIDE;
24 virtual void Unlock() OVERRIDE; 24 virtual void Unlock() OVERRIDE;
25 virtual void* Memory() const OVERRIDE; 25 virtual void* Memory() const OVERRIDE;
26 26
27 private: 27 private:
28 scoped_ptr<uint8, FreeDeleter> memory_; 28 scoped_ptr<uint8, FreeDeleter> memory_;
29 bool is_locked_; 29 bool is_locked_;
30 30
31 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryEmulated); 31 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryEmulated);
32 }; 32 };
33 33
34 } // namespace internal 34 } // namespace internal
35 } // namespace base 35 } // namespace base
36 36
37 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_ 37 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_android.cc ('k') | base/memory/discardable_memory_emulated.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698