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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <string> | 10 #include <string> |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 !blink::WebRuntimeFeatures::isEncryptedMediaEnabled()) { | 752 !blink::WebRuntimeFeatures::isEncryptedMediaEnabled()) { |
753 return; | 753 return; |
754 } | 754 } |
755 | 755 |
756 // TODO(xhwang): Update this UMA name. | 756 // TODO(xhwang): Update this UMA name. |
757 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1); | 757 UMA_HISTOGRAM_COUNTS("Media.EME.NeedKey", 1); |
758 | 758 |
759 encrypted_media_support_.SetInitDataType(init_data_type); | 759 encrypted_media_support_.SetInitDataType(init_data_type); |
760 | 760 |
761 encrypted_client_->encrypted( | 761 encrypted_client_->encrypted( |
762 ConvertToWebInitDataType(init_data_type), vector_as_array(&init_data), | 762 ConvertToWebInitDataType(init_data_type), init_data.data(), |
763 base::saturated_cast<unsigned int>(init_data.size())); | 763 base::saturated_cast<unsigned int>(init_data.size())); |
764 } | 764 } |
765 | 765 |
766 void WebMediaPlayerImpl::OnWaitingForDecryptionKey() { | 766 void WebMediaPlayerImpl::OnWaitingForDecryptionKey() { |
767 encrypted_client_->didBlockPlaybackWaitingForKey(); | 767 encrypted_client_->didBlockPlaybackWaitingForKey(); |
768 | 768 |
769 // TODO(jrummell): didResumePlaybackBlockedForKey() should only be called | 769 // TODO(jrummell): didResumePlaybackBlockedForKey() should only be called |
770 // when a key has been successfully added (e.g. OnSessionKeysChange() with | 770 // when a key has been successfully added (e.g. OnSessionKeysChange() with |
771 // |has_additional_usable_key| = true). http://crbug.com/461903 | 771 // |has_additional_usable_key| = true). http://crbug.com/461903 |
772 encrypted_client_->didResumePlaybackBlockedForKey(); | 772 encrypted_client_->didResumePlaybackBlockedForKey(); |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 << ", Video: " << stats.video_memory_usage << ", DataSource: " | 1111 << ", Video: " << stats.video_memory_usage << ", DataSource: " |
1112 << (data_source_ ? data_source_->GetMemoryUsage() : 0) | 1112 << (data_source_ ? data_source_->GetMemoryUsage() : 0) |
1113 << ", Demuxer: " << (demuxer_ ? demuxer_->GetMemoryUsage() : 0); | 1113 << ", Demuxer: " << (demuxer_ ? demuxer_->GetMemoryUsage() : 0); |
1114 | 1114 |
1115 const int64_t delta = current_memory_usage - last_reported_memory_usage_; | 1115 const int64_t delta = current_memory_usage - last_reported_memory_usage_; |
1116 last_reported_memory_usage_ = current_memory_usage; | 1116 last_reported_memory_usage_ = current_memory_usage; |
1117 adjust_allocated_memory_cb_.Run(delta); | 1117 adjust_allocated_memory_cb_.Run(delta); |
1118 } | 1118 } |
1119 | 1119 |
1120 } // namespace media | 1120 } // namespace media |
OLD | NEW |