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

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

Issue 869043008: Reland of Move tracing namespace from base::debug to base::trace_event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Fix suppressions Created 5 years, 10 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 (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 {
11 namespace debug { 11 namespace trace_event {
12 12
13 TracedValue::TracedValue() : root_(new DictionaryValue()) { 13 TracedValue::TracedValue() : root_(new DictionaryValue()) {
14 stack_.push_back(root_.get()); 14 stack_.push_back(root_.get());
15 } 15 }
16 16
17 TracedValue::~TracedValue() { 17 TracedValue::~TracedValue() {
18 DCHECK_EQ(1u, stack_.size()); 18 DCHECK_EQ(1u, stack_.size());
19 } 19 }
20 20
21 void TracedValue::SetInteger(const char* name, int value) { 21 void TracedValue::SetInteger(const char* name, int value) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 debug 116 } // namespace trace_event
117 } // namespace base 117 } // namespace base
OLDNEW
« no previous file with comments | « base/trace_event/trace_event_argument.h ('k') | base/trace_event/trace_event_argument_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698