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 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1325 void WebMediaPlayerAndroid::OnKeyAdded(const std::string& session_id) { | 1325 void WebMediaPlayerAndroid::OnKeyAdded(const std::string& session_id) { |
1326 EmeUMAHistogramCounts(current_key_system_, "KeyAdded", 1); | 1326 EmeUMAHistogramCounts(current_key_system_, "KeyAdded", 1); |
1327 | 1327 |
1328 client_->keyAdded( | 1328 client_->keyAdded( |
1329 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), | 1329 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), |
1330 WebString::fromUTF8(session_id)); | 1330 WebString::fromUTF8(session_id)); |
1331 } | 1331 } |
1332 | 1332 |
1333 void WebMediaPlayerAndroid::OnKeyError(const std::string& session_id, | 1333 void WebMediaPlayerAndroid::OnKeyError(const std::string& session_id, |
1334 media::MediaKeys::KeyError error_code, | 1334 media::MediaKeys::KeyError error_code, |
1335 int system_code) { | 1335 uint32 system_code) { |
1336 EmeUMAHistogramEnumeration(current_key_system_, "KeyError", | 1336 EmeUMAHistogramEnumeration(current_key_system_, "KeyError", |
1337 error_code, media::MediaKeys::kMaxKeyError); | 1337 error_code, media::MediaKeys::kMaxKeyError); |
1338 | 1338 |
1339 unsigned short short_system_code = 0; | |
1340 if (system_code > std::numeric_limits<unsigned short>::max()) { | |
1341 LOG(WARNING) << "system_code exceeds unsigned short limit."; | |
ddorwin
2014/03/01 06:18:09
Should we make it 0xffff or something?
xhwang
2014/03/03 19:06:36
Done.
| |
1342 } else { | |
1343 short_system_code = static_cast<unsigned short>(system_code); | |
1344 } | |
1345 | |
1339 client_->keyError( | 1346 client_->keyError( |
1340 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), | 1347 WebString::fromUTF8(GetPrefixedKeySystemName(current_key_system_)), |
1341 WebString::fromUTF8(session_id), | 1348 WebString::fromUTF8(session_id), |
1342 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), | 1349 static_cast<blink::WebMediaPlayerClient::MediaKeyErrorCode>(error_code), |
1343 system_code); | 1350 short_system_code); |
1344 } | 1351 } |
1345 | 1352 |
1346 void WebMediaPlayerAndroid::OnKeyMessage(const std::string& session_id, | 1353 void WebMediaPlayerAndroid::OnKeyMessage(const std::string& session_id, |
1347 const std::vector<uint8>& message, | 1354 const std::vector<uint8>& message, |
1348 const std::string& destination_url) { | 1355 const std::string& destination_url) { |
1349 const GURL destination_url_gurl(destination_url); | 1356 const GURL destination_url_gurl(destination_url); |
1350 DLOG_IF(WARNING, !destination_url.empty() && !destination_url_gurl.is_valid()) | 1357 DLOG_IF(WARNING, !destination_url.empty() && !destination_url_gurl.is_valid()) |
1351 << "Invalid URL in destination_url: " << destination_url; | 1358 << "Invalid URL in destination_url: " << destination_url; |
1352 | 1359 |
1353 client_->keyMessage( | 1360 client_->keyMessage( |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1434 | 1441 |
1435 void WebMediaPlayerAndroid::exitFullscreen() { | 1442 void WebMediaPlayerAndroid::exitFullscreen() { |
1436 manager_->ExitFullscreen(player_id_); | 1443 manager_->ExitFullscreen(player_id_); |
1437 } | 1444 } |
1438 | 1445 |
1439 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1446 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
1440 return manager_->CanEnterFullscreen(frame_); | 1447 return manager_->CanEnterFullscreen(frame_); |
1441 } | 1448 } |
1442 | 1449 |
1443 } // namespace content | 1450 } // namespace content |
OLD | NEW |