| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/glue/media/buffered_data_source.h" | 5 #include "webkit/glue/media/buffered_data_source.h" |
| 6 | 6 |
| 7 #include "media/base/filter_host.h" | 7 #include "media/base/filter_host.h" |
| 8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
| 9 #include "webkit/glue/media/web_data_source_factory.h" | 9 #include "webkit/glue/media/web_data_source_factory.h" |
| 10 #include "webkit/glue/webkit_glue.h" | 10 #include "webkit/glue/webkit_glue.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Post a task to complete the initialization task. | 127 // Post a task to complete the initialization task. |
| 128 render_loop_->PostTask(FROM_HERE, | 128 render_loop_->PostTask(FROM_HERE, |
| 129 NewRunnableMethod(this, &BufferedDataSource::InitializeTask)); | 129 NewRunnableMethod(this, &BufferedDataSource::InitializeTask)); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void BufferedDataSource::CancelInitialize() { | 132 void BufferedDataSource::CancelInitialize() { |
| 133 base::AutoLock auto_lock(lock_); | 133 base::AutoLock auto_lock(lock_); |
| 134 DCHECK(initialize_callback_.get()); | 134 DCHECK(initialize_callback_.get()); |
| 135 | 135 |
| 136 initialize_callback_.reset(); | 136 initialize_callback_.reset(); |
| 137 |
| 138 render_loop_->PostTask( |
| 139 FROM_HERE, NewRunnableMethod(this, &BufferedDataSource::CleanupTask)); |
| 137 } | 140 } |
| 138 | 141 |
| 139 ///////////////////////////////////////////////////////////////////////////// | 142 ///////////////////////////////////////////////////////////////////////////// |
| 140 // media::Filter implementation. | 143 // media::Filter implementation. |
| 141 void BufferedDataSource::Stop(media::FilterCallback* callback) { | 144 void BufferedDataSource::Stop(media::FilterCallback* callback) { |
| 142 { | 145 { |
| 143 base::AutoLock auto_lock(lock_); | 146 base::AutoLock auto_lock(lock_); |
| 144 stop_signal_received_ = true; | 147 stop_signal_received_ = true; |
| 145 } | 148 } |
| 146 if (callback) { | 149 if (callback) { |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 657 |
| 655 if (streaming_) { | 658 if (streaming_) { |
| 656 filter_host->SetStreaming(true); | 659 filter_host->SetStreaming(true); |
| 657 } else { | 660 } else { |
| 658 filter_host->SetTotalBytes(total_bytes_); | 661 filter_host->SetTotalBytes(total_bytes_); |
| 659 filter_host->SetBufferedBytes(buffered_bytes_); | 662 filter_host->SetBufferedBytes(buffered_bytes_); |
| 660 } | 663 } |
| 661 } | 664 } |
| 662 | 665 |
| 663 } // namespace webkit_glue | 666 } // namespace webkit_glue |
| OLD | NEW |