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

Unified Diff: media/base/pipeline.cc

Issue 16823003: Replace erroneous use of base::Time with base::TimeTicks throughout media code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/PresubmitPromptWarning/PresubmitPromptOrNotify/ Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/pipeline.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline.cc
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index 68483fc22377220926222135d27fefab3196c93c..419ae3162904cedc42a19fd8b41448676082ad08 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -39,7 +39,7 @@ Pipeline::Pipeline(const scoped_refptr<base::MessageLoopProxy>& message_loop,
natural_size_(0, 0),
volume_(1.0f),
playback_rate_(0.0f),
- clock_(new Clock(&default_clock_)),
+ clock_(new Clock(&default_tick_clock_)),
waiting_for_clock_update_(false),
status_(PIPELINE_OK),
has_audio_(false),
@@ -49,7 +49,7 @@ Pipeline::Pipeline(const scoped_refptr<base::MessageLoopProxy>& message_loop,
video_ended_(false),
audio_disabled_(false),
demuxer_(NULL),
- creation_time_(base::Time::Now()) {
+ creation_time_(default_tick_clock_.NowTicks()) {
media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated));
media_log_->AddEvent(
media_log_->CreateEvent(MediaLogEvent::PIPELINE_CREATED));
@@ -213,9 +213,9 @@ void Pipeline::SetErrorForTesting(PipelineStatus status) {
void Pipeline::SetState(State next_state) {
if (state_ != kStarted && next_state == kStarted &&
!creation_time_.is_null()) {
- UMA_HISTOGRAM_TIMES(
- "Media.TimeToPipelineStarted", base::Time::Now() - creation_time_);
- creation_time_ = base::Time();
+ UMA_HISTOGRAM_TIMES("Media.TimeToPipelineStarted",
+ default_tick_clock_.NowTicks() - creation_time_);
+ creation_time_ = base::TimeTicks();
}
DVLOG(2) << GetStateString(state_) << " -> " << GetStateString(next_state);
« no previous file with comments | « media/base/pipeline.h ('k') | media/base/pipeline_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698