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

Side by Side Diff: base/test/test_discardable_memory_shmem_allocator.cc

Issue 1004043002: Re-land: base: Implement browser process support for discardable memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 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 namespace base {
8 namespace {
9
10 class DiscardableMemoryShmemChunkImpl : public DiscardableMemoryShmemChunk {
11 public:
12 explicit DiscardableMemoryShmemChunkImpl(size_t size)
13 : memory_(new uint8[size]) {}
Avi (use Gerrit) 2015/03/13 21:05:26 As noted in basictypes.h, do not use these aliases
reveman 2015/03/13 21:31:23 Done
14
15 // Overridden from DiscardableMemoryShmemChunk:
16 bool Lock() override { return false; }
17 void Unlock() override {}
18 void* Memory() const override { return memory_.get(); }
19
20 private:
21 scoped_ptr<uint8[]> memory_;
22 };
23
24 } // namespace
25
26 TestDiscardableMemoryShmemAllocator::TestDiscardableMemoryShmemAllocator() {
27 }
28
29 TestDiscardableMemoryShmemAllocator::~TestDiscardableMemoryShmemAllocator() {
30 }
31
32 scoped_ptr<DiscardableMemoryShmemChunk>
33 TestDiscardableMemoryShmemAllocator::AllocateLockedDiscardableMemory(
34 size_t size) {
35 return make_scoped_ptr(new DiscardableMemoryShmemChunkImpl(size));
36 }
37
38 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698