Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: trunk/src/content/renderer/media/webmediaplayer_impl.cc

Issue 198163004: Revert 257524 "Move IsStringASCII/UTF8 to base namespace." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698