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/webmediaplayer_impl.h" | 5 #include "webkit/glue/webmediaplayer_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 return static_cast<float>(pipeline_->GetCurrentTime().InSecondsF()); | 498 return static_cast<float>(pipeline_->GetCurrentTime().InSecondsF()); |
499 } | 499 } |
500 | 500 |
501 int WebMediaPlayerImpl::dataRate() const { | 501 int WebMediaPlayerImpl::dataRate() const { |
502 DCHECK(MessageLoop::current() == main_loop_); | 502 DCHECK(MessageLoop::current() == main_loop_); |
503 | 503 |
504 // TODO(hclam): Add this method call if pipeline has it in the interface. | 504 // TODO(hclam): Add this method call if pipeline has it in the interface. |
505 return 0; | 505 return 0; |
506 } | 506 } |
507 | 507 |
| 508 WebKit::WebMediaPlayer::NetworkState WebMediaPlayerImpl::networkState() const { |
| 509 return network_state_; |
| 510 } |
| 511 |
| 512 WebKit::WebMediaPlayer::ReadyState WebMediaPlayerImpl::readyState() const { |
| 513 return ready_state_; |
| 514 } |
| 515 |
508 const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() { | 516 const WebKit::WebTimeRanges& WebMediaPlayerImpl::buffered() { |
509 DCHECK(MessageLoop::current() == main_loop_); | 517 DCHECK(MessageLoop::current() == main_loop_); |
510 | 518 |
511 // Update buffered_ with the most recent buffered time. | 519 // Update buffered_ with the most recent buffered time. |
512 if (buffered_.size() > 0) { | 520 if (buffered_.size() > 0) { |
513 float buffered_time = static_cast<float>( | 521 float buffered_time = static_cast<float>( |
514 pipeline_->GetBufferedTime().InSecondsF()); | 522 pipeline_->GetBufferedTime().InSecondsF()); |
515 if (buffered_time >= buffered_[0].start) | 523 if (buffered_time >= buffered_[0].start) |
516 buffered_[0].end = buffered_time; | 524 buffered_[0].end = buffered_time; |
517 } | 525 } |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 pipeline_stopped_.Signal(); | 809 pipeline_stopped_.Signal(); |
802 } | 810 } |
803 | 811 |
804 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { | 812 WebKit::WebMediaPlayerClient* WebMediaPlayerImpl::GetClient() { |
805 DCHECK(MessageLoop::current() == main_loop_); | 813 DCHECK(MessageLoop::current() == main_loop_); |
806 DCHECK(client_); | 814 DCHECK(client_); |
807 return client_; | 815 return client_; |
808 } | 816 } |
809 | 817 |
810 } // namespace webkit_glue | 818 } // namespace webkit_glue |
OLD | NEW |