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

Side by Side Diff: base/trace_event/memory_allocator_dump.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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
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 #ifndef BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_H_ 5 #ifndef BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_H_
6 #define BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_H_ 6 #define BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory>
10 #include <string> 11 #include <string>
11 12
12 #include "base/base_export.h" 13 #include "base/base_export.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "base/trace_event/memory_allocator_dump_guid.h" 16 #include "base/trace_event/memory_allocator_dump_guid.h"
17 #include "base/values.h" 17 #include "base/values.h"
18 18
19 namespace base { 19 namespace base {
20 namespace trace_event { 20 namespace trace_event {
21 21
22 class MemoryDumpManager; 22 class MemoryDumpManager;
23 class ProcessMemoryDump; 23 class ProcessMemoryDump;
24 class TracedValue; 24 class TracedValue;
25 25
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // cross process sharing. See crbug.com/492102 for design docs. 86 // cross process sharing. See crbug.com/492102 for design docs.
87 // Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are 87 // Subsequent MemoryAllocatorDump(s) with the same |absolute_name| are
88 // expected to have the same guid. 88 // expected to have the same guid.
89 const MemoryAllocatorDumpGuid& guid() const { return guid_; } 89 const MemoryAllocatorDumpGuid& guid() const { return guid_; }
90 90
91 TracedValue* attributes_for_testing() const { return attributes_.get(); } 91 TracedValue* attributes_for_testing() const { return attributes_.get(); }
92 92
93 private: 93 private:
94 const std::string absolute_name_; 94 const std::string absolute_name_;
95 ProcessMemoryDump* const process_memory_dump_; // Not owned (PMD owns this). 95 ProcessMemoryDump* const process_memory_dump_; // Not owned (PMD owns this).
96 scoped_ptr<TracedValue> attributes_; 96 std::unique_ptr<TracedValue> attributes_;
97 MemoryAllocatorDumpGuid guid_; 97 MemoryAllocatorDumpGuid guid_;
98 int flags_; // See enum Flags. 98 int flags_; // See enum Flags.
99 99
100 // A local buffer for Sprintf conversion on fastpath. Avoids allocating 100 // A local buffer for Sprintf conversion on fastpath. Avoids allocating
101 // temporary strings on each AddScalar() call. 101 // temporary strings on each AddScalar() call.
102 std::string string_conversion_buffer_; 102 std::string string_conversion_buffer_;
103 103
104 DISALLOW_COPY_AND_ASSIGN(MemoryAllocatorDump); 104 DISALLOW_COPY_AND_ASSIGN(MemoryAllocatorDump);
105 }; 105 };
106 106
107 } // namespace trace_event 107 } // namespace trace_event
108 } // namespace base 108 } // namespace base
109 109
110 #endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_H_ 110 #endif // BASE_TRACE_EVENT_MEMORY_ALLOCATOR_DUMP_H_
OLDNEW
« no previous file with comments | « base/trace_event/malloc_dump_provider.cc ('k') | base/trace_event/memory_allocator_dump_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698