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 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 WebMediaPlayer::MediaKeyException e) { | 741 WebMediaPlayer::MediaKeyException e) { |
742 MediaKeyException result_id = MediaKeyExceptionForUMA(e); | 742 MediaKeyException result_id = MediaKeyExceptionForUMA(e); |
743 DCHECK_NE(result_id, kUnknownResultId) << e; | 743 DCHECK_NE(result_id, kUnknownResultId) << e; |
744 EmeUMAHistogramEnumeration( | 744 EmeUMAHistogramEnumeration( |
745 key_system, method, result_id, kMaxMediaKeyException); | 745 key_system, method, result_id, kMaxMediaKeyException); |
746 } | 746 } |
747 | 747 |
748 // Convert a WebString to ASCII, falling back on an empty string in the case | 748 // Convert a WebString to ASCII, falling back on an empty string in the case |
749 // of a non-ASCII string. | 749 // of a non-ASCII string. |
750 static std::string ToASCIIOrEmpty(const blink::WebString& string) { | 750 static std::string ToASCIIOrEmpty(const blink::WebString& string) { |
751 return base::IsStringASCII(string) ? base::UTF16ToASCII(string) | 751 return IsStringASCII(string) ? base::UTF16ToASCII(string) : std::string(); |
752 : std::string(); | |
753 } | 752 } |
754 | 753 |
755 WebMediaPlayer::MediaKeyException | 754 WebMediaPlayer::MediaKeyException |
756 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, | 755 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, |
757 const unsigned char* init_data, | 756 const unsigned char* init_data, |
758 unsigned init_data_length) { | 757 unsigned init_data_length) { |
759 DVLOG(1) << "generateKeyRequest: " << base::string16(key_system) << ": " | 758 DVLOG(1) << "generateKeyRequest: " << base::string16(key_system) << ": " |
760 << std::string(reinterpret_cast<const char*>(init_data), | 759 << std::string(reinterpret_cast<const char*>(init_data), |
761 static_cast<size_t>(init_data_length)); | 760 static_cast<size_t>(init_data_length)); |
762 | 761 |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 | 1323 |
1325 if (web_cdm_) { | 1324 if (web_cdm_) { |
1326 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); | 1325 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); |
1327 return; | 1326 return; |
1328 } | 1327 } |
1329 | 1328 |
1330 decryptor_ready_cb_ = decryptor_ready_cb; | 1329 decryptor_ready_cb_ = decryptor_ready_cb; |
1331 } | 1330 } |
1332 | 1331 |
1333 } // namespace content | 1332 } // namespace content |
OLD | NEW |