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

Side by Side Diff: base/trace_event/trace_event_argument.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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 | « base/json/json_writer_unittest.cc ('k') | base/trace_event/trace_event_system_stats_monitor.cc » ('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 (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
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
OLDNEW
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/trace_event/trace_event_system_stats_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698