Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |