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

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

Issue 11607003: Add a Clock and TickClock interface for mocking out time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix warnings Created 7 years, 10 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/pipeline.h ('k') | media/base/pipeline_unittest.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/pipeline.h" 5 #include "media/base/pipeline.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 Pipeline::Pipeline(const scoped_refptr<base::MessageLoopProxy>& message_loop, 65 Pipeline::Pipeline(const scoped_refptr<base::MessageLoopProxy>& message_loop,
66 MediaLog* media_log) 66 MediaLog* media_log)
67 : message_loop_(message_loop), 67 : message_loop_(message_loop),
68 media_log_(media_log), 68 media_log_(media_log),
69 running_(false), 69 running_(false),
70 did_loading_progress_(false), 70 did_loading_progress_(false),
71 total_bytes_(0), 71 total_bytes_(0),
72 natural_size_(0, 0), 72 natural_size_(0, 0),
73 volume_(1.0f), 73 volume_(1.0f),
74 playback_rate_(0.0f), 74 playback_rate_(0.0f),
75 clock_(new Clock(&base::Time::Now)), 75 clock_(new Clock(&default_clock_)),
76 waiting_for_clock_update_(false), 76 waiting_for_clock_update_(false),
77 status_(PIPELINE_OK), 77 status_(PIPELINE_OK),
78 has_audio_(false), 78 has_audio_(false),
79 has_video_(false), 79 has_video_(false),
80 state_(kCreated), 80 state_(kCreated),
81 audio_ended_(false), 81 audio_ended_(false),
82 video_ended_(false), 82 video_ended_(false),
83 audio_disabled_(false), 83 audio_disabled_(false),
84 creation_time_(base::Time::Now()) { 84 creation_time_(base::Time::Now()) {
85 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated)); 85 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated));
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() { 975 void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() {
976 lock_.AssertAcquired(); 976 lock_.AssertAcquired();
977 if (!waiting_for_clock_update_) 977 if (!waiting_for_clock_update_)
978 return; 978 return;
979 979
980 waiting_for_clock_update_ = false; 980 waiting_for_clock_update_ = false;
981 clock_->Play(); 981 clock_->Play();
982 } 982 }
983 983
984 } // namespace media 984 } // namespace media
OLDNEW
« 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