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

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

Issue 196793010: Move IsStringASCII/UTF8 to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698