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

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

Issue 2160963002: Add watch time metrics for HTML5 media playback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only log watch time once. Created 4 years, 4 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
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 <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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 case MediaLogEvent::BUFFERED_EXTENTS_CHANGED: 75 case MediaLogEvent::BUFFERED_EXTENTS_CHANGED:
76 return "BUFFERED_EXTENTS_CHANGED"; 76 return "BUFFERED_EXTENTS_CHANGED";
77 case MediaLogEvent::MEDIA_ERROR_LOG_ENTRY: 77 case MediaLogEvent::MEDIA_ERROR_LOG_ENTRY:
78 return "MEDIA_ERROR_LOG_ENTRY"; 78 return "MEDIA_ERROR_LOG_ENTRY";
79 case MediaLogEvent::MEDIA_INFO_LOG_ENTRY: 79 case MediaLogEvent::MEDIA_INFO_LOG_ENTRY:
80 return "MEDIA_INFO_LOG_ENTRY"; 80 return "MEDIA_INFO_LOG_ENTRY";
81 case MediaLogEvent::MEDIA_DEBUG_LOG_ENTRY: 81 case MediaLogEvent::MEDIA_DEBUG_LOG_ENTRY:
82 return "MEDIA_DEBUG_LOG_ENTRY"; 82 return "MEDIA_DEBUG_LOG_ENTRY";
83 case MediaLogEvent::PROPERTY_CHANGE: 83 case MediaLogEvent::PROPERTY_CHANGE:
84 return "PROPERTY_CHANGE"; 84 return "PROPERTY_CHANGE";
85 case MediaLogEvent::WATCH_TIME_UPDATE:
86 return "WATCH_TIME_UPDATE";
85 } 87 }
86 NOTREACHED(); 88 NOTREACHED();
87 return NULL; 89 return NULL;
88 } 90 }
89 91
90 std::string MediaLog::PipelineStatusToString(PipelineStatus status) { 92 std::string MediaLog::PipelineStatusToString(PipelineStatus status) {
91 switch (status) { 93 switch (status) {
92 case PIPELINE_OK: 94 case PIPELINE_OK:
93 return "pipeline: ok"; 95 return "pipeline: ok";
94 case PIPELINE_ERROR_NETWORK: 96 case PIPELINE_ERROR_NETWORK:
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 const scoped_refptr<MediaLog>& media_log) 287 const scoped_refptr<MediaLog>& media_log)
286 : level_(level), media_log_(media_log) { 288 : level_(level), media_log_(media_log) {
287 DCHECK(media_log_.get()); 289 DCHECK(media_log_.get());
288 } 290 }
289 291
290 LogHelper::~LogHelper() { 292 LogHelper::~LogHelper() {
291 media_log_->AddLogEvent(level_, stream_.str()); 293 media_log_->AddLogEvent(level_, stream_.str());
292 } 294 }
293 295
294 } //namespace media 296 } //namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698