| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 return media_source_delegate_->Buffered(); | 415 return media_source_delegate_->Buffered(); |
| 416 return buffered_; | 416 return buffered_; |
| 417 } | 417 } |
| 418 | 418 |
| 419 double WebMediaPlayerAndroid::maxTimeSeekable() const { | 419 double WebMediaPlayerAndroid::maxTimeSeekable() const { |
| 420 // If we haven't even gotten to ReadyStateHaveMetadata yet then just | 420 // If we haven't even gotten to ReadyStateHaveMetadata yet then just |
| 421 // return 0 so that the seekable range is empty. | 421 // return 0 so that the seekable range is empty. |
| 422 if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata) | 422 if (ready_state_ < WebMediaPlayer::ReadyStateHaveMetadata) |
| 423 return 0.0; | 423 return 0.0; |
| 424 | 424 |
| 425 if (duration() == std::numeric_limits<double>::infinity()) | 425 return duration(); |
| 426 return 0.0; | |
| 427 | |
| 428 return std::min(std::numeric_limits<int32>::max() / 1000.0, duration()); | |
| 429 } | 426 } |
| 430 | 427 |
| 431 bool WebMediaPlayerAndroid::didLoadingProgress() const { | 428 bool WebMediaPlayerAndroid::didLoadingProgress() const { |
| 432 bool ret = did_loading_progress_; | 429 bool ret = did_loading_progress_; |
| 433 did_loading_progress_ = false; | 430 did_loading_progress_ = false; |
| 434 return ret; | 431 return ret; |
| 435 } | 432 } |
| 436 | 433 |
| 437 void WebMediaPlayerAndroid::paint(blink::WebCanvas* canvas, | 434 void WebMediaPlayerAndroid::paint(blink::WebCanvas* canvas, |
| 438 const blink::WebRect& rect, | 435 const blink::WebRect& rect, |
| (...skipping 1095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 | 1531 |
| 1535 void WebMediaPlayerAndroid::exitFullscreen() { | 1532 void WebMediaPlayerAndroid::exitFullscreen() { |
| 1536 manager_->ExitFullscreen(player_id_); | 1533 manager_->ExitFullscreen(player_id_); |
| 1537 } | 1534 } |
| 1538 | 1535 |
| 1539 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1536 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
| 1540 return manager_->CanEnterFullscreen(frame_); | 1537 return manager_->CanEnterFullscreen(frame_); |
| 1541 } | 1538 } |
| 1542 | 1539 |
| 1543 } // namespace content | 1540 } // namespace content |
| OLD | NEW |