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

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

Issue 111713008: base: Refactor DiscardableMemoryProvider to build and be tested on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/base.gypi ('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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_
6 #define BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_
7
8 #include "base/memory/discardable_memory.h"
9
10 namespace base {
11
12 class DiscardableMemoryEmulated : public DiscardableMemory {
Philippe 2013/12/11 08:56:27 Should we have this in base::internal?
reveman 2013/12/12 06:54:23 Done.
13 public:
14 explicit DiscardableMemoryEmulated(size_t size);
15 virtual ~DiscardableMemoryEmulated();
16
17 static void PurgeForTesting();
18
19 bool Initialize();
Philippe 2013/12/11 08:56:27 Just a suggestion, feel free to ignore :) I see t
reveman 2013/12/12 06:54:23 I prefer to avoid static Create functions when pos
Philippe 2013/12/12 08:53:35 Fair enough, I would tend to avoid such inheritanc
reveman 2013/12/12 16:25:16 Composition can definitely make more sense in some
20
21 // Overridden from DiscardableMemory:
22 virtual LockDiscardableMemoryStatus Lock() OVERRIDE;
23 virtual void Unlock() OVERRIDE;
24 virtual void* Memory() const OVERRIDE;
25
26 private:
27 scoped_ptr<uint8, FreeDeleter> memory_;
28 bool is_locked_;
29
30 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryEmulated);
31 };
32
33 } // namespace base
34
35 #endif // BASE_MEMORY_DISCARDABLE_MEMORY_EMULATED_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/memory/discardable_memory_emulated.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698