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

Side by Side Diff: media/base/media_log.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 | « jingle/glue/utils.cc ('k') | media/cast/sender/fake_software_video_encoder.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "media/base/media_log.h" 5 #include "media/base/media_log.h"
6 6
7 7
8 #include "base/atomic_sequence_num.h" 8 #include "base/atomic_sequence_num.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // event for figuring out media pipeline failures, and just reporting 132 // event for figuring out media pipeline failures, and just reporting
133 // pipeline status as numeric code is not very helpful/user-friendly. 133 // pipeline status as numeric code is not very helpful/user-friendly.
134 int error_code = 0; 134 int error_code = 0;
135 if (event.type == MediaLogEvent::PIPELINE_ERROR && 135 if (event.type == MediaLogEvent::PIPELINE_ERROR &&
136 event.params.GetInteger("pipeline_error", &error_code)) { 136 event.params.GetInteger("pipeline_error", &error_code)) {
137 PipelineStatus status = static_cast<PipelineStatus>(error_code); 137 PipelineStatus status = static_cast<PipelineStatus>(error_code);
138 return EventTypeToString(event.type) + " " + 138 return EventTypeToString(event.type) + " " +
139 media::MediaLog::PipelineStatusToString(status); 139 media::MediaLog::PipelineStatusToString(status);
140 } 140 }
141 std::string params_json; 141 std::string params_json;
142 base::JSONWriter::Write(&event.params, &params_json); 142 base::JSONWriter::Write(event.params, &params_json);
143 return EventTypeToString(event.type) + " " + params_json; 143 return EventTypeToString(event.type) + " " + params_json;
144 } 144 }
145 145
146 MediaLog::MediaLog() : id_(g_media_log_count.GetNext()) {} 146 MediaLog::MediaLog() : id_(g_media_log_count.GetNext()) {}
147 147
148 MediaLog::~MediaLog() {} 148 MediaLog::~MediaLog() {}
149 149
150 void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {} 150 void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {}
151 151
152 scoped_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) { 152 scoped_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) {
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 : level_(level), log_cb_(log_cb) { 282 : level_(level), log_cb_(log_cb) {
283 } 283 }
284 284
285 LogHelper::~LogHelper() { 285 LogHelper::~LogHelper() {
286 if (log_cb_.is_null()) 286 if (log_cb_.is_null())
287 return; 287 return;
288 log_cb_.Run(level_, stream_.str()); 288 log_cb_.Run(level_, stream_.str());
289 } 289 }
290 290
291 } //namespace media 291 } //namespace media
OLDNEW
« no previous file with comments | « jingle/glue/utils.cc ('k') | media/cast/sender/fake_software_video_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698