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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 scoped_ptr<MediaLogEvent> MediaLog::CreateStringEvent( | 134 scoped_ptr<MediaLogEvent> MediaLog::CreateStringEvent( |
135 MediaLogEvent::Type type, const char* property, const std::string& value) { | 135 MediaLogEvent::Type type, const char* property, const std::string& value) { |
136 scoped_ptr<MediaLogEvent> event(CreateEvent(type)); | 136 scoped_ptr<MediaLogEvent> event(CreateEvent(type)); |
137 event->params.SetString(property, value); | 137 event->params.SetString(property, value); |
138 return event.Pass(); | 138 return event.Pass(); |
139 } | 139 } |
140 | 140 |
141 scoped_ptr<MediaLogEvent> MediaLog::CreateTimeEvent( | 141 scoped_ptr<MediaLogEvent> MediaLog::CreateTimeEvent( |
142 MediaLogEvent::Type type, const char* property, base::TimeDelta value) { | 142 MediaLogEvent::Type type, const char* property, base::TimeDelta value) { |
143 scoped_ptr<MediaLogEvent> event(CreateEvent(type)); | 143 scoped_ptr<MediaLogEvent> event(CreateEvent(type)); |
144 event->params.SetDouble(property, value.InSecondsF()); | 144 if (value.is_max()) |
| 145 event->params.SetString(property, "unknown"); |
| 146 else |
| 147 event->params.SetDouble(property, value.InSecondsF()); |
145 return event.Pass(); | 148 return event.Pass(); |
146 } | 149 } |
147 | 150 |
148 scoped_ptr<MediaLogEvent> MediaLog::CreateLoadEvent(const std::string& url) { | 151 scoped_ptr<MediaLogEvent> MediaLog::CreateLoadEvent(const std::string& url) { |
149 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::LOAD)); | 152 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::LOAD)); |
150 event->params.SetString("url", url); | 153 event->params.SetString("url", url); |
151 return event.Pass(); | 154 return event.Pass(); |
152 } | 155 } |
153 | 156 |
154 scoped_ptr<MediaLogEvent> MediaLog::CreateSeekEvent(float seconds) { | 157 scoped_ptr<MediaLogEvent> MediaLog::CreateSeekEvent(float seconds) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 225 } |
223 | 226 |
224 void MediaLog::SetBooleanProperty( | 227 void MediaLog::SetBooleanProperty( |
225 const char* key, bool value) { | 228 const char* key, bool value) { |
226 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); | 229 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); |
227 event->params.SetBoolean(key, value); | 230 event->params.SetBoolean(key, value); |
228 AddEvent(event.Pass()); | 231 AddEvent(event.Pass()); |
229 } | 232 } |
230 | 233 |
231 } //namespace media | 234 } //namespace media |
OLD | NEW |