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

Side by Side Diff: base/test/test_discardable_memory_shmem_allocator.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
« no previous file with comments | « base/test/test_discardable_memory_shmem_allocator.h ('k') | base/third_party/nspr/BUILD.gn » ('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 2015 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/test/test_discardable_memory_shmem_allocator.h"
6
7 #include <stdint.h>
8
9 namespace base {
10 namespace {
11
12 class DiscardableMemoryShmemChunkImpl : public DiscardableMemoryShmemChunk {
13 public:
14 explicit DiscardableMemoryShmemChunkImpl(size_t size)
15 : memory_(new uint8_t[size]) {}
16
17 // Overridden from DiscardableMemoryShmemChunk:
18 bool Lock() override { return false; }
19 void Unlock() override {}
20 void* Memory() const override { return memory_.get(); }
21
22 private:
23 scoped_ptr<uint8_t[]> memory_;
24 };
25
26 } // namespace
27
28 TestDiscardableMemoryShmemAllocator::TestDiscardableMemoryShmemAllocator() {
29 }
30
31 TestDiscardableMemoryShmemAllocator::~TestDiscardableMemoryShmemAllocator() {
32 }
33
34 scoped_ptr<DiscardableMemoryShmemChunk>
35 TestDiscardableMemoryShmemAllocator::AllocateLockedDiscardableMemory(
36 size_t size) {
37 return make_scoped_ptr(new DiscardableMemoryShmemChunkImpl(size));
38 }
39
40 } // namespace base
OLDNEW
« no previous file with comments | « base/test/test_discardable_memory_shmem_allocator.h ('k') | base/third_party/nspr/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698