| 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/trace_event/memory_allocator_attributes.h" |
| 6 |
| 7 namespace base { |
| 8 namespace trace_event { |
| 9 |
| 10 MemoryAllocatorDeclaredAttributes::MemoryAllocatorDeclaredAttributes() { |
| 11 } |
| 12 |
| 13 MemoryAllocatorDeclaredAttributes::~MemoryAllocatorDeclaredAttributes() { |
| 14 } |
| 15 |
| 16 void MemoryAllocatorDeclaredAttributes::Add( |
| 17 const MemoryAllocatorDeclaredAttribute& attr) { |
| 18 DCHECK_EQ(0u, attributes_.count(attr.name)); |
| 19 attributes_[attr.name] = attr; |
| 20 } |
| 21 |
| 22 const MemoryAllocatorDeclaredAttribute* MemoryAllocatorDeclaredAttributes::Get( |
| 23 const std::string& name) const { |
| 24 auto it = attributes_.find(name); |
| 25 return it == attributes_.end() ? nullptr : &(it->second); |
| 26 } |
| 27 |
| 28 } // namespace trace_event |
| 29 } // namespace base |
| OLD | NEW |