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/webmediaplayer_impl.h" | 5 #include "content/renderer/media/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1055 text_track_index_++)); | 1055 text_track_index_++)); |
1056 | 1056 |
1057 scoped_ptr<media::TextTrack> text_track( | 1057 scoped_ptr<media::TextTrack> text_track( |
1058 new TextTrackImpl(main_loop_, client_, web_inband_text_track.Pass())); | 1058 new TextTrackImpl(main_loop_, client_, web_inband_text_track.Pass())); |
1059 | 1059 |
1060 done_cb.Run(text_track.Pass()); | 1060 done_cb.Run(text_track.Pass()); |
1061 } | 1061 } |
1062 | 1062 |
1063 void WebMediaPlayerImpl::OnKeyError(const std::string& session_id, | 1063 void WebMediaPlayerImpl::OnKeyError(const std::string& session_id, |
1064 media::MediaKeys::KeyError error_code, | 1064 media::MediaKeys::KeyError error_code, |
1065 int system_code) { | 1065 uint32 system_code) { |
1066 DCHECK(main_loop_->BelongsToCurrentThread()); | 1066 DCHECK(main_loop_->BelongsToCurrentThread()); |
1067 | 1067 |
1068 EmeUMAHistogramEnumeration(current_key_system_, "KeyError", | 1068 EmeUMAHistogramEnumeration(current_key_system_, "KeyError", |
1069 error_code, media::MediaKeys::kMaxKeyError); | 1069 error_code, media::MediaKeys::kMaxKeyError); |
1070 | 1070 |
1071 unsigned short short_system_code = 0; | |
1072 if (system_code > std::numeric_limits<unsigned short>::max()) { | |
1073 LOG(WARNING) << "system_code exceeds unsigned short limit."; | |
ddorwin
2014/03/01 06:18:09
ditto
xhwang
2014/03/03 19:06:36
Done.
| |
1074 } else { | |
1075 short_system_code = static_cast<unsigned short>(system_code); | |
1076 } | |
1077 | |
1071 client_->keyError( | 1078 client_->keyError( |
1072 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), | 1079 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), |
1073 WebString::fromUTF8(session_id), | 1080 WebString::fromUTF8(session_id), |
1074 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), | 1081 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), |
1075 system_code); | 1082 short_system_code); |
1076 } | 1083 } |
1077 | 1084 |
1078 void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id, | 1085 void WebMediaPlayerImpl::OnKeyMessage(const std::string& session_id, |
1079 const std::vector<uint8>& message, | 1086 const std::vector<uint8>& message, |
1080 const std::string& default_url) { | 1087 const std::string& default_url) { |
1081 DCHECK(main_loop_->BelongsToCurrentThread()); | 1088 DCHECK(main_loop_->BelongsToCurrentThread()); |
1082 | 1089 |
1083 const GURL default_url_gurl(default_url); | 1090 const GURL default_url_gurl(default_url); |
1084 DLOG_IF(WARNING, !default_url.empty() && !default_url_gurl.is_valid()) | 1091 DLOG_IF(WARNING, !default_url.empty() && !default_url_gurl.is_valid()) |
1085 << "Invalid URL in default_url: " << default_url; | 1092 << "Invalid URL in default_url: " << default_url; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1316 | 1323 |
1317 if (web_cdm_) { | 1324 if (web_cdm_) { |
1318 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); | 1325 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); |
1319 return; | 1326 return; |
1320 } | 1327 } |
1321 | 1328 |
1322 decryptor_ready_cb_ = decryptor_ready_cb; | 1329 decryptor_ready_cb_ = decryptor_ready_cb; |
1323 } | 1330 } |
1324 | 1331 |
1325 } // namespace content | 1332 } // namespace content |
OLD | NEW |