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

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

Issue 1013463003: Update from https://crrev.com/320931 (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
OLDNEW
(Empty)
1 // Copyright (c) 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 #include "base/memory/discardable_memory.h"
6
7 #include "base/logging.h"
8 #include "base/memory/discardable_memory_shmem.h"
9 #include "base/memory/scoped_ptr.h"
10
11 namespace base {
12
13 // static
14 void DiscardableMemory::GetSupportedTypes(
15 std::vector<DiscardableMemoryType>* types) {
16 const DiscardableMemoryType supported_types[] = {
17 DISCARDABLE_MEMORY_TYPE_SHMEM
18 };
19 types->assign(supported_types, supported_types + arraysize(supported_types));
20 }
21
22 // static
23 scoped_ptr<DiscardableMemory> DiscardableMemory::CreateLockedMemoryWithType(
24 DiscardableMemoryType type, size_t size) {
25 switch (type) {
26 case DISCARDABLE_MEMORY_TYPE_SHMEM:
27 return make_scoped_ptr(new internal::DiscardableMemoryShmem(size));
28 case DISCARDABLE_MEMORY_TYPE_NONE:
29 NOTREACHED();
30 return nullptr;
31 }
32
33 NOTREACHED();
34 return nullptr;
35 }
36
37 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/discardable_memory_linux.cc ('k') | base/memory/discardable_memory_shmem_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698