| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/media/webmediaplayer_impl.h" | 5 #include "webkit/media/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 message.get(), | 944 message.get(), |
| 945 message_length); | 945 message_length); |
| 946 } | 946 } |
| 947 | 947 |
| 948 void WebMediaPlayerImpl::SetOpaque(bool opaque) { | 948 void WebMediaPlayerImpl::SetOpaque(bool opaque) { |
| 949 DCHECK_EQ(main_loop_, MessageLoop::current()); | 949 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 950 | 950 |
| 951 GetClient()->setOpaque(opaque); | 951 GetClient()->setOpaque(opaque); |
| 952 } | 952 } |
| 953 | 953 |
| 954 void WebMediaPlayerImpl::DataSourceInitialized( | 954 void WebMediaPlayerImpl::DataSourceInitialized(const GURL& gurl, bool success) { |
| 955 const GURL& gurl, | |
| 956 media::PipelineStatus status) { | |
| 957 DCHECK_EQ(main_loop_, MessageLoop::current()); | 955 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 958 | 956 |
| 959 if (status != media::PIPELINE_OK) { | 957 if (!success) { |
| 960 DVLOG(1) << "DataSourceInitialized status: " << status; | |
| 961 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); | 958 SetNetworkState(WebMediaPlayer::NetworkStateFormatError); |
| 962 Repaint(); | 959 Repaint(); |
| 963 return; | 960 return; |
| 964 } | 961 } |
| 965 | 962 |
| 966 StartPipeline(); | 963 StartPipeline(); |
| 967 } | 964 } |
| 968 | 965 |
| 969 void WebMediaPlayerImpl::NotifyDownloading(bool is_downloading) { | 966 void WebMediaPlayerImpl::NotifyDownloading(bool is_downloading) { |
| 970 if (!is_downloading && network_state_ == WebMediaPlayer::NetworkStateLoading) | 967 if (!is_downloading && network_state_ == WebMediaPlayer::NetworkStateLoading) |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 return audio_source_provider_; | 1046 return audio_source_provider_; |
| 1050 } | 1047 } |
| 1051 | 1048 |
| 1052 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { | 1049 void WebMediaPlayerImpl::IncrementExternallyAllocatedMemory() { |
| 1053 DCHECK_EQ(main_loop_, MessageLoop::current()); | 1050 DCHECK_EQ(main_loop_, MessageLoop::current()); |
| 1054 incremented_externally_allocated_memory_ = true; | 1051 incremented_externally_allocated_memory_ = true; |
| 1055 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); | 1052 v8::V8::AdjustAmountOfExternalAllocatedMemory(kPlayerExtraMemory); |
| 1056 } | 1053 } |
| 1057 | 1054 |
| 1058 } // namespace webkit_media | 1055 } // namespace webkit_media |
| OLD | NEW |