OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TRACE_EVENT_ARGUMENT_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_ARGUMENT_H_ |
6 #define BASE_TRACE_EVENT_TRACE_EVENT_ARGUMENT_H_ | 6 #define BASE_TRACE_EVENT_TRACE_EVENT_ARGUMENT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <memory> |
10 #include <string> | 11 #include <string> |
11 #include <vector> | 12 #include <vector> |
12 | 13 |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "base/pickle.h" | 15 #include "base/pickle.h" |
16 #include "base/strings/string_piece.h" | 16 #include "base/strings/string_piece.h" |
17 #include "base/trace_event/trace_event_impl.h" | 17 #include "base/trace_event/trace_event_impl.h" |
18 | 18 |
19 namespace base { | 19 namespace base { |
20 | 20 |
21 class Value; | 21 class Value; |
22 | 22 |
23 namespace trace_event { | 23 namespace trace_event { |
24 | 24 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // ConvertableToTraceFormat implementation. | 61 // ConvertableToTraceFormat implementation. |
62 void AppendAsTraceFormat(std::string* out) const override; | 62 void AppendAsTraceFormat(std::string* out) const override; |
63 | 63 |
64 void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead) override; | 64 void EstimateTraceMemoryOverhead(TraceEventMemoryOverhead* overhead) override; |
65 | 65 |
66 // DEPRECATED: do not use, here only for legacy reasons. These methods causes | 66 // DEPRECATED: do not use, here only for legacy reasons. These methods causes |
67 // a copy-and-translation of the base::Value into the equivalent TracedValue. | 67 // a copy-and-translation of the base::Value into the equivalent TracedValue. |
68 // TODO(primiano): migrate the (three) existing clients to the cheaper | 68 // TODO(primiano): migrate the (three) existing clients to the cheaper |
69 // SetValue(TracedValue) API. crbug.com/495628. | 69 // SetValue(TracedValue) API. crbug.com/495628. |
70 void SetValue(const char* name, scoped_ptr<base::Value> value); | 70 void SetValue(const char* name, std::unique_ptr<base::Value> value); |
71 void SetBaseValueWithCopiedName(base::StringPiece name, | 71 void SetBaseValueWithCopiedName(base::StringPiece name, |
72 const base::Value& value); | 72 const base::Value& value); |
73 void AppendBaseValue(const base::Value& value); | 73 void AppendBaseValue(const base::Value& value); |
74 | 74 |
75 // Public for tests only. | 75 // Public for tests only. |
76 scoped_ptr<base::Value> ToBaseValue() const; | 76 std::unique_ptr<base::Value> ToBaseValue() const; |
77 | 77 |
78 private: | 78 private: |
79 Pickle pickle_; | 79 Pickle pickle_; |
80 | 80 |
81 #ifndef NDEBUG | 81 #ifndef NDEBUG |
82 // In debug builds checks the pairings of {Start,End}{Dictionary,Array} | 82 // In debug builds checks the pairings of {Start,End}{Dictionary,Array} |
83 std::vector<bool> nesting_stack_; | 83 std::vector<bool> nesting_stack_; |
84 #endif | 84 #endif |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(TracedValue); | 86 DISALLOW_COPY_AND_ASSIGN(TracedValue); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace trace_event | 89 } // namespace trace_event |
90 } // namespace base | 90 } // namespace base |
91 | 91 |
92 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ARGUMENT_H_ | 92 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ARGUMENT_H_ |
OLD | NEW |