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

Side by Side Diff: base/memory/discardable_memory.cc

Issue 114923005: base: Discardable memory types. (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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
Philippe 2013/12/17 14:28:21 Nit: I believe there is no '(c)' anymore for new f
reveman 2013/12/18 08:12:38 Done.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/memory/discardable_memory.h"
6
7 #include "base/lazy_instance.h"
8
9 namespace base {
10 namespace {
11
12 struct DiscardableMemoryTypeInitializedWithPreferredValue {
13 DiscardableMemoryTypeInitializedWithPreferredValue()
14 : v(DiscardableMemory::GetSupportedTypes().front()) {
15 }
16
17 DiscardableMemoryType v;
Philippe 2013/12/17 14:28:21 Nit: maybe call this 'value' or 'type'.
reveman 2013/12/18 08:12:38 Done.
18 };
19 LazyInstance<DiscardableMemoryTypeInitializedWithPreferredValue>::Leaky
20 g_discardable_memory_type = LAZY_INSTANCE_INITIALIZER;
21
22 } // namespace
23
24 // static
25 void DiscardableMemory::SetType(DiscardableMemoryType type) {
26 g_discardable_memory_type.Get().v = type;
27 }
28
29 // static
30 DiscardableMemoryType DiscardableMemory::GetType() {
31 return g_discardable_memory_type.Get().v;
32 }
33
34 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698