OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "base/trace_event/trace_event_argument.h" | 5 #include "base/trace_event/trace_event_argument.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 | 9 |
10 namespace base { | 10 namespace base { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 ListValue* TracedValue::GetCurrentArray() { | 101 ListValue* TracedValue::GetCurrentArray() { |
102 DCHECK(!stack_.empty()); | 102 DCHECK(!stack_.empty()); |
103 ListValue* list = NULL; | 103 ListValue* list = NULL; |
104 stack_.back()->GetAsList(&list); | 104 stack_.back()->GetAsList(&list); |
105 DCHECK(list); | 105 DCHECK(list); |
106 return list; | 106 return list; |
107 } | 107 } |
108 | 108 |
109 void TracedValue::AppendAsTraceFormat(std::string* out) const { | 109 void TracedValue::AppendAsTraceFormat(std::string* out) const { |
110 std::string tmp; | 110 std::string tmp; |
111 JSONWriter::Write(stack_.front(), &tmp); | 111 JSONWriter::Write(*stack_.front(), &tmp); |
112 *out += tmp; | 112 *out += tmp; |
113 DCHECK_EQ(1u, stack_.size()) << tmp; | 113 DCHECK_EQ(1u, stack_.size()) << tmp; |
114 } | 114 } |
115 | 115 |
116 } // namespace trace_event | 116 } // namespace trace_event |
117 } // namespace base | 117 } // namespace base |
OLD | NEW |