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

Side by Side Diff: test/test_discardable_memory_allocator.cc

Issue 2045303002: Update to Chromium //base at Chromium commit 3e81715e6d3a4324362635aea46ce1f1a163cca1. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/domokit/base@master
Patch Set: Created 4 years, 6 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 | « test/launcher/unit_test_launcher.cc ('k') | test/test_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/test/test_discardable_memory_allocator.h" 5 #include "base/test/test_discardable_memory_allocator.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/memory/discardable_memory.h" 9 #include "base/memory/discardable_memory.h"
10 10
11 namespace base { 11 namespace base {
12 namespace { 12 namespace {
13 13
14 class DiscardableMemoryImpl : public DiscardableMemory { 14 class DiscardableMemoryImpl : public DiscardableMemory {
15 public: 15 public:
16 explicit DiscardableMemoryImpl(size_t size) : data_(new uint8_t[size]) {} 16 explicit DiscardableMemoryImpl(size_t size) : data_(new uint8_t[size]) {}
17 17
18 // Overridden from DiscardableMemory: 18 // Overridden from DiscardableMemory:
19 bool Lock() override { return false; } 19 bool Lock() override { return false; }
20 void Unlock() override {} 20 void Unlock() override {}
21 void* data() const override { return data_.get(); } 21 void* data() const override { return data_.get(); }
22 22
23 trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump(
24 const char* name,
25 trace_event::ProcessMemoryDump* pmd) const override {
26 return nullptr;
27 }
28
23 private: 29 private:
24 scoped_ptr<uint8_t[]> data_; 30 scoped_ptr<uint8_t[]> data_;
25 }; 31 };
26 32
27 } // namespace 33 } // namespace
28 34
29 TestDiscardableMemoryAllocator::TestDiscardableMemoryAllocator() { 35 TestDiscardableMemoryAllocator::TestDiscardableMemoryAllocator() {
30 } 36 }
31 37
32 TestDiscardableMemoryAllocator::~TestDiscardableMemoryAllocator() { 38 TestDiscardableMemoryAllocator::~TestDiscardableMemoryAllocator() {
33 } 39 }
34 40
35 scoped_ptr<DiscardableMemory> 41 scoped_ptr<DiscardableMemory>
36 TestDiscardableMemoryAllocator::AllocateLockedDiscardableMemory(size_t size) { 42 TestDiscardableMemoryAllocator::AllocateLockedDiscardableMemory(size_t size) {
37 return make_scoped_ptr(new DiscardableMemoryImpl(size)); 43 return make_scoped_ptr(new DiscardableMemoryImpl(size));
38 } 44 }
39 45
40 } // namespace base 46 } // namespace base
OLDNEW
« no previous file with comments | « test/launcher/unit_test_launcher.cc ('k') | test/test_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698