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

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

Issue 2735383002: Media: Add improved duration histogram (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('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/pipeline_impl.h" 5 #include "media/base/pipeline_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 base::AutoLock auto_lock(shared_state_lock_); 498 base::AutoLock auto_lock(shared_state_lock_);
499 shared_state_.did_loading_progress = true; 499 shared_state_.did_loading_progress = true;
500 shared_state_.buffered_time_ranges = ranges; 500 shared_state_.buffered_time_ranges = ranges;
501 } 501 }
502 502
503 void PipelineImpl::RendererWrapper::SetDuration(base::TimeDelta duration) { 503 void PipelineImpl::RendererWrapper::SetDuration(base::TimeDelta duration) {
504 // TODO(alokp): Add thread DCHECK after ensuring that all Demuxer 504 // TODO(alokp): Add thread DCHECK after ensuring that all Demuxer
505 // implementations call DemuxerHost on the media thread. 505 // implementations call DemuxerHost on the media thread.
506 media_log_->AddEvent(media_log_->CreateTimeEvent(MediaLogEvent::DURATION_SET, 506 media_log_->AddEvent(media_log_->CreateTimeEvent(MediaLogEvent::DURATION_SET,
507 "duration", duration)); 507 "duration", duration));
508 UMA_HISTOGRAM_LONG_TIMES("Media.Duration", duration); 508 UMA_HISTOGRAM_CUSTOM_TIMES(
509 "Media.Duration2", duration, base::TimeDelta::FromMilliseconds(1),
510 base::TimeDelta::FromDays(1), 50 /* bucket_count */);
509 511
510 main_task_runner_->PostTask( 512 main_task_runner_->PostTask(
511 FROM_HERE, 513 FROM_HERE,
512 base::Bind(&PipelineImpl::OnDurationChange, weak_pipeline_, duration)); 514 base::Bind(&PipelineImpl::OnDurationChange, weak_pipeline_, duration));
513 } 515 }
514 516
515 void PipelineImpl::RendererWrapper::OnDemuxerError(PipelineStatus error) { 517 void PipelineImpl::RendererWrapper::OnDemuxerError(PipelineStatus error) {
516 // TODO(alokp): Add thread DCHECK after ensuring that all Demuxer 518 // TODO(alokp): Add thread DCHECK after ensuring that all Demuxer
517 // implementations call DemuxerHost on the media thread. 519 // implementations call DemuxerHost on the media thread.
518 media_task_runner_->PostTask( 520 media_task_runner_->PostTask(
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after
1360 void PipelineImpl::OnSuspendDone() { 1362 void PipelineImpl::OnSuspendDone() {
1361 DVLOG(3) << __func__; 1363 DVLOG(3) << __func__;
1362 DCHECK(thread_checker_.CalledOnValidThread()); 1364 DCHECK(thread_checker_.CalledOnValidThread());
1363 DCHECK(IsRunning()); 1365 DCHECK(IsRunning());
1364 1366
1365 DCHECK(!suspend_cb_.is_null()); 1367 DCHECK(!suspend_cb_.is_null());
1366 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK); 1368 base::ResetAndReturn(&suspend_cb_).Run(PIPELINE_OK);
1367 } 1369 }
1368 1370
1369 } // namespace media 1371 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698