OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, | 5 // TODO(scherkus): clean up PipelineImpl... too many crazy function names, |
6 // potential deadlocks, etc... | 6 // potential deadlocks, etc... |
7 | 7 |
8 #include "media/base/pipeline_impl.h" | 8 #include "media/base/pipeline_impl.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 scoped_refptr<CompositeFilter> composite_; | 62 scoped_refptr<CompositeFilter> composite_; |
63 }; | 63 }; |
64 | 64 |
65 PipelineImpl::PipelineImpl(MessageLoop* message_loop, MediaLog* media_log) | 65 PipelineImpl::PipelineImpl(MessageLoop* message_loop, MediaLog* media_log) |
66 : message_loop_(message_loop), | 66 : message_loop_(message_loop), |
67 media_log_(media_log), | 67 media_log_(media_log), |
68 clock_(new Clock(&base::Time::Now)), | 68 clock_(new Clock(&base::Time::Now)), |
69 waiting_for_clock_update_(false), | 69 waiting_for_clock_update_(false), |
70 state_(kCreated), | 70 state_(kCreated), |
71 current_bytes_(0), | 71 current_bytes_(0), |
72 creation_time_(base::Time::Now()) { | 72 creation_time_(base::Time::Now()), |
| 73 is_downloading_data_(false) { |
73 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated)); | 74 media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated)); |
74 ResetState(); | 75 ResetState(); |
75 media_log_->AddEvent( | 76 media_log_->AddEvent( |
76 media_log_->CreateEvent(MediaLogEvent::PIPELINE_CREATED)); | 77 media_log_->CreateEvent(MediaLogEvent::PIPELINE_CREATED)); |
77 } | 78 } |
78 | 79 |
79 PipelineImpl::~PipelineImpl() { | 80 PipelineImpl::~PipelineImpl() { |
80 base::AutoLock auto_lock(lock_); | 81 base::AutoLock auto_lock(lock_); |
81 DCHECK(!running_) << "Stop() must complete before destroying object"; | 82 DCHECK(!running_) << "Stop() must complete before destroying object"; |
82 DCHECK(!stop_pending_); | 83 DCHECK(!stop_pending_); |
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1423 message_loop_->PostTask(FROM_HERE, | 1424 message_loop_->PostTask(FROM_HERE, |
1424 base::Bind(&PipelineImpl::NotifyCanPlayThrough, this)); | 1425 base::Bind(&PipelineImpl::NotifyCanPlayThrough, this)); |
1425 } | 1426 } |
1426 | 1427 |
1427 void PipelineImpl::NotifyCanPlayThrough() { | 1428 void PipelineImpl::NotifyCanPlayThrough() { |
1428 DCHECK_EQ(MessageLoop::current(), message_loop_); | 1429 DCHECK_EQ(MessageLoop::current(), message_loop_); |
1429 NotifyNetworkEventTask(CAN_PLAY_THROUGH); | 1430 NotifyNetworkEventTask(CAN_PLAY_THROUGH); |
1430 } | 1431 } |
1431 | 1432 |
1432 } // namespace media | 1433 } // namespace media |
OLD | NEW |