Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 std::string params_json; | 142 std::string params_json; |
| 143 base::JSONWriter::Write(event.params, ¶ms_json); | 143 base::JSONWriter::Write(event.params, ¶ms_json); |
| 144 return EventTypeToString(event.type) + " " + params_json; | 144 return EventTypeToString(event.type) + " " + params_json; |
| 145 } | 145 } |
| 146 | 146 |
| 147 MediaLog::MediaLog() : id_(g_media_log_count.GetNext()) {} | 147 MediaLog::MediaLog() : id_(g_media_log_count.GetNext()) {} |
| 148 | 148 |
| 149 MediaLog::~MediaLog() {} | 149 MediaLog::~MediaLog() {} |
| 150 | 150 |
| 151 void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {} | 151 void MediaLog::AddEvent(scoped_ptr<MediaLogEvent> event) {} |
| 152 std::string MediaLog::GetLastErrorMessage() { | |
|
watk
2016/04/04 23:47:25
new line before this?
wolenetz
2016/04/05 00:23:27
Done.
| |
| 153 return ""; | |
| 154 } | |
| 152 | 155 |
| 153 scoped_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) { | 156 scoped_ptr<MediaLogEvent> MediaLog::CreateEvent(MediaLogEvent::Type type) { |
| 154 scoped_ptr<MediaLogEvent> event(new MediaLogEvent); | 157 scoped_ptr<MediaLogEvent> event(new MediaLogEvent); |
| 155 event->id = id_; | 158 event->id = id_; |
| 156 event->type = type; | 159 event->type = type; |
| 157 event->time = base::TimeTicks::Now(); | 160 event->time = base::TimeTicks::Now(); |
| 158 return event; | 161 return event; |
| 159 } | 162 } |
| 160 | 163 |
| 161 scoped_ptr<MediaLogEvent> MediaLog::CreateBooleanEvent( | 164 scoped_ptr<MediaLogEvent> MediaLog::CreateBooleanEvent( |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 const scoped_refptr<MediaLog>& media_log) | 272 const scoped_refptr<MediaLog>& media_log) |
| 270 : level_(level), media_log_(media_log) { | 273 : level_(level), media_log_(media_log) { |
| 271 DCHECK(media_log_.get()); | 274 DCHECK(media_log_.get()); |
| 272 } | 275 } |
| 273 | 276 |
| 274 LogHelper::~LogHelper() { | 277 LogHelper::~LogHelper() { |
| 275 media_log_->AddLogEvent(level_, stream_.str()); | 278 media_log_->AddLogEvent(level_, stream_.str()); |
| 276 } | 279 } |
| 277 | 280 |
| 278 } //namespace media | 281 } //namespace media |
| OLD | NEW |