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 IsStringASCII(string) ? base::UTF16ToASCII(string) : std::string(); | 751 return base::IsStringASCII(string) ? base::UTF16ToASCII(string) |
| 752 : std::string(); |
752 } | 753 } |
753 | 754 |
754 WebMediaPlayer::MediaKeyException | 755 WebMediaPlayer::MediaKeyException |
755 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, | 756 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, |
756 const unsigned char* init_data, | 757 const unsigned char* init_data, |
757 unsigned init_data_length) { | 758 unsigned init_data_length) { |
758 DVLOG(1) << "generateKeyRequest: " << base::string16(key_system) << ": " | 759 DVLOG(1) << "generateKeyRequest: " << base::string16(key_system) << ": " |
759 << std::string(reinterpret_cast<const char*>(init_data), | 760 << std::string(reinterpret_cast<const char*>(init_data), |
760 static_cast<size_t>(init_data_length)); | 761 static_cast<size_t>(init_data_length)); |
761 | 762 |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 | 1324 |
1324 if (web_cdm_) { | 1325 if (web_cdm_) { |
1325 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); | 1326 decryptor_ready_cb.Run(web_cdm_->GetDecryptor()); |
1326 return; | 1327 return; |
1327 } | 1328 } |
1328 | 1329 |
1329 decryptor_ready_cb_ = decryptor_ready_cb; | 1330 decryptor_ready_cb_ = decryptor_ready_cb; |
1330 } | 1331 } |
1331 | 1332 |
1332 } // namespace content | 1333 } // namespace content |
OLD | NEW |