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

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

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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_shmem_allocator.h ('k') | base/message_loop/message_loop.h » ('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 #include "base/memory/discardable_memory_shmem_allocator.h"
6
7 #include "base/lazy_instance.h"
8 #include "base/logging.h"
9 #include "base/memory/discardable_shared_memory.h"
10
11 namespace base {
12 namespace {
13
14 DiscardableMemoryShmemAllocator* g_allocator = nullptr;
15
16 } // namespace
17
18 // static
19 void DiscardableMemoryShmemAllocator::SetInstance(
20 DiscardableMemoryShmemAllocator* allocator) {
21 DCHECK(allocator);
22
23 // Make sure this function is only called once before the first call
24 // to GetInstance().
25 DCHECK(!g_allocator);
26
27 g_allocator = allocator;
28 }
29
30 // static
31 DiscardableMemoryShmemAllocator*
32 DiscardableMemoryShmemAllocator::GetInstance() {
33 DCHECK(g_allocator);
34 return g_allocator;
35 }
36
37 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_shmem_allocator.h ('k') | base/message_loop/message_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698