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

Side by Side Diff: media/base/media_log.cc

Issue 179813009: Revert of Reland "Add base::TimeDelta::Max()" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « media/base/buffers.h ('k') | media/filters/chunk_demuxer.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 #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
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 if (value.is_max()) 144 event->params.SetDouble(property, value.InSecondsF());
145 event->params.SetString(property, "unknown");
146 else
147 event->params.SetDouble(property, value.InSecondsF());
148 return event.Pass(); 145 return event.Pass();
149 } 146 }
150 147
151 scoped_ptr<MediaLogEvent> MediaLog::CreateLoadEvent(const std::string& url) { 148 scoped_ptr<MediaLogEvent> MediaLog::CreateLoadEvent(const std::string& url) {
152 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::LOAD)); 149 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::LOAD));
153 event->params.SetString("url", url); 150 event->params.SetString("url", url);
154 return event.Pass(); 151 return event.Pass();
155 } 152 }
156 153
157 scoped_ptr<MediaLogEvent> MediaLog::CreateSeekEvent(float seconds) { 154 scoped_ptr<MediaLogEvent> MediaLog::CreateSeekEvent(float seconds) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 } 222 }
226 223
227 void MediaLog::SetBooleanProperty( 224 void MediaLog::SetBooleanProperty(
228 const char* key, bool value) { 225 const char* key, bool value) {
229 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE)); 226 scoped_ptr<MediaLogEvent> event(CreateEvent(MediaLogEvent::PROPERTY_CHANGE));
230 event->params.SetBoolean(key, value); 227 event->params.SetBoolean(key, value);
231 AddEvent(event.Pass()); 228 AddEvent(event.Pass());
232 } 229 }
233 230
234 } //namespace media 231 } //namespace media
OLDNEW
« no previous file with comments | « media/base/buffers.h ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698