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

Side by Side Diff: ui/events/latency_info.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 | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/events/latency_info.h" 5 #include "ui/events/latency_info.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 LatencyInfoTracedValue::FromValue(scoped_ptr<base::Value> value) { 101 LatencyInfoTracedValue::FromValue(scoped_ptr<base::Value> value) {
102 return scoped_refptr<base::trace_event::ConvertableToTraceFormat>( 102 return scoped_refptr<base::trace_event::ConvertableToTraceFormat>(
103 new LatencyInfoTracedValue(value.release())); 103 new LatencyInfoTracedValue(value.release()));
104 } 104 }
105 105
106 LatencyInfoTracedValue::~LatencyInfoTracedValue() { 106 LatencyInfoTracedValue::~LatencyInfoTracedValue() {
107 } 107 }
108 108
109 void LatencyInfoTracedValue::AppendAsTraceFormat(std::string* out) const { 109 void LatencyInfoTracedValue::AppendAsTraceFormat(std::string* out) const {
110 std::string tmp; 110 std::string tmp;
111 base::JSONWriter::Write(value_.get(), &tmp); 111 base::JSONWriter::Write(*value_, &tmp);
112 *out += tmp; 112 *out += tmp;
113 } 113 }
114 114
115 LatencyInfoTracedValue::LatencyInfoTracedValue(base::Value* value) 115 LatencyInfoTracedValue::LatencyInfoTracedValue(base::Value* value)
116 : value_(value) { 116 : value_(value) {
117 } 117 }
118 118
119 // Converts latencyinfo into format that can be dumped into trace buffer. 119 // Converts latencyinfo into format that can be dumped into trace buffer.
120 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsTraceableData( 120 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsTraceableData(
121 const ui::LatencyInfo& latency) { 121 const ui::LatencyInfo& latency) {
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 it++; 366 it++;
367 } 367 }
368 } 368 }
369 } 369 }
370 370
371 void LatencyInfo::Clear() { 371 void LatencyInfo::Clear() {
372 latency_components.clear(); 372 latency_components.clear();
373 } 373 }
374 374
375 } // namespace ui 375 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698