Chromium Code Reviews| 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/webmediaplayer_impl.h" | 5 #include "webkit/glue/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 793 SetNetworkState(WebMediaPlayer::DecodeError); | 793 SetNetworkState(WebMediaPlayer::DecodeError); |
| 794 break; | 794 break; |
| 795 } | 795 } |
| 796 | 796 |
| 797 // Repaint to trigger UI update. | 797 // Repaint to trigger UI update. |
| 798 Repaint(); | 798 Repaint(); |
| 799 } | 799 } |
| 800 | 800 |
| 801 void WebMediaPlayerImpl::OnNetworkEvent(bool is_downloading_data) { | 801 void WebMediaPlayerImpl::OnNetworkEvent(bool is_downloading_data) { |
| 802 DCHECK_EQ(main_loop_, MessageLoop::current()); | 802 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 803 if (is_downloading_data) | 803 if (is_downloading_data) { |
| 804 SetNetworkState(WebKit::WebMediaPlayer::Loading); | 804 SetNetworkState(WebKit::WebMediaPlayer::Loading); |
| 805 else | 805 // Issue repaint so buffering progress stays up to date when paused. |
| 806 if (paused_) | |
| 807 Repaint(); | |
|
scherkus (not reviewing)
2011/11/09 03:47:33
also I wonder whether a repaint() here is the righ
DaleCurtis
2011/11/09 18:30:02
Would a comparison to host->GetBufferedBytes() and
| |
| 808 } else | |
|
scherkus (not reviewing)
2011/11/09 03:45:28
nit: use return and exit early instead of else
DaleCurtis
2011/11/09 18:30:02
Done.
| |
| 806 SetNetworkState(WebKit::WebMediaPlayer::Idle); | 809 SetNetworkState(WebKit::WebMediaPlayer::Idle); |
| 807 } | 810 } |
| 808 | 811 |
| 809 void WebMediaPlayerImpl::OnDemuxerOpened() { | 812 void WebMediaPlayerImpl::OnDemuxerOpened() { |
| 810 DCHECK_EQ(main_loop_, MessageLoop::current()); | 813 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 811 | 814 |
| 812 GetClient()->sourceOpened(); | 815 GetClient()->sourceOpened(); |
| 813 } | 816 } |
| 814 | 817 |
| 815 void WebMediaPlayerImpl::SetNetworkState( | 818 void WebMediaPlayerImpl::SetNetworkState( |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 868 return client_; | 871 return client_; |
| 869 } | 872 } |
| 870 | 873 |
| 871 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 874 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 872 DCHECK_EQ(main_loop_, MessageLoop::current()); | 875 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 873 incremented_externally_allocated_memory_ = true; | 876 incremented_externally_allocated_memory_ = true; |
| 874 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 877 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 875 } | 878 } |
| 876 | 879 |
| 877 } // namespace webkit_glue | 880 } // namespace webkit_glue |
| OLD | NEW |