| 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 #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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 read_callback_->RunWithParams( | 405 read_callback_->RunWithParams( |
| 406 Tuple1<size_t>(static_cast<size_t>(media::DataSource::kReadError))); | 406 Tuple1<size_t>(static_cast<size_t>(media::DataSource::kReadError))); |
| 407 } | 407 } |
| 408 | 408 |
| 409 read_callback_.reset(); | 409 read_callback_.reset(); |
| 410 read_position_ = 0; | 410 read_position_ = 0; |
| 411 read_size_ = 0; | 411 read_size_ = 0; |
| 412 read_buffer_ = 0; | 412 read_buffer_ = 0; |
| 413 } | 413 } |
| 414 | 414 |
| 415 void BufferedDataSource::DoneInitialization_Locked(media::PipelineError error) { | 415 void BufferedDataSource::DoneInitialization_Locked( |
| 416 media::PipelineStatus status) { |
| 416 DCHECK(MessageLoop::current() == render_loop_); | 417 DCHECK(MessageLoop::current() == render_loop_); |
| 417 DCHECK(initialize_callback_.get()); | 418 DCHECK(initialize_callback_.get()); |
| 418 lock_.AssertAcquired(); | 419 lock_.AssertAcquired(); |
| 419 | 420 |
| 420 scoped_ptr<media::PipelineStatusCallback> initialize_callback( | 421 scoped_ptr<media::PipelineStatusCallback> initialize_callback( |
| 421 initialize_callback_.release()); | 422 initialize_callback_.release()); |
| 422 initialize_callback->Run(error); | 423 initialize_callback->Run(status); |
| 423 } | 424 } |
| 424 | 425 |
| 425 ///////////////////////////////////////////////////////////////////////////// | 426 ///////////////////////////////////////////////////////////////////////////// |
| 426 // BufferedResourceLoader callback methods. | 427 // BufferedResourceLoader callback methods. |
| 427 void BufferedDataSource::HttpInitialStartCallback(int error) { | 428 void BufferedDataSource::HttpInitialStartCallback(int error) { |
| 428 DCHECK(MessageLoop::current() == render_loop_); | 429 DCHECK(MessageLoop::current() == render_loop_); |
| 429 DCHECK(loader_.get()); | 430 DCHECK(loader_.get()); |
| 430 | 431 |
| 431 int64 instance_size = loader_->instance_size(); | 432 int64 instance_size = loader_->instance_size(); |
| 432 bool partial_response = loader_->partial_response(); | 433 bool partial_response = loader_->partial_response(); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 655 |
| 655 if (streaming_) { | 656 if (streaming_) { |
| 656 filter_host->SetStreaming(true); | 657 filter_host->SetStreaming(true); |
| 657 } else { | 658 } else { |
| 658 filter_host->SetTotalBytes(total_bytes_); | 659 filter_host->SetTotalBytes(total_bytes_); |
| 659 filter_host->SetBufferedBytes(buffered_bytes_); | 660 filter_host->SetBufferedBytes(buffered_bytes_); |
| 660 } | 661 } |
| 661 } | 662 } |
| 662 | 663 |
| 663 } // namespace webkit_glue | 664 } // namespace webkit_glue |
| OLD | NEW |