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

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

Issue 270183002: Move IsStringUTF8/ASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more minor nit Created 6 years, 7 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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 WebMediaPlayer::MediaKeyException e) { 739 WebMediaPlayer::MediaKeyException e) {
740 MediaKeyException result_id = MediaKeyExceptionForUMA(e); 740 MediaKeyException result_id = MediaKeyExceptionForUMA(e);
741 DCHECK_NE(result_id, kUnknownResultId) << e; 741 DCHECK_NE(result_id, kUnknownResultId) << e;
742 EmeUMAHistogramEnumeration( 742 EmeUMAHistogramEnumeration(
743 key_system, method, result_id, kMaxMediaKeyException); 743 key_system, method, result_id, kMaxMediaKeyException);
744 } 744 }
745 745
746 // Convert a WebString to ASCII, falling back on an empty string in the case 746 // Convert a WebString to ASCII, falling back on an empty string in the case
747 // of a non-ASCII string. 747 // of a non-ASCII string.
748 static std::string ToASCIIOrEmpty(const blink::WebString& string) { 748 static std::string ToASCIIOrEmpty(const blink::WebString& string) {
749 return IsStringASCII(string) ? base::UTF16ToASCII(string) : std::string(); 749 return base::IsStringASCII(string) ? base::UTF16ToASCII(string)
750 : std::string();
750 } 751 }
751 752
752 WebMediaPlayer::MediaKeyException 753 WebMediaPlayer::MediaKeyException
753 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system, 754 WebMediaPlayerImpl::generateKeyRequest(const WebString& key_system,
754 const unsigned char* init_data, 755 const unsigned char* init_data,
755 unsigned init_data_length) { 756 unsigned init_data_length) {
756 DVLOG(1) << "generateKeyRequest: " << base::string16(key_system) << ": " 757 DVLOG(1) << "generateKeyRequest: " << base::string16(key_system) << ": "
757 << std::string(reinterpret_cast<const char*>(init_data), 758 << std::string(reinterpret_cast<const char*>(init_data),
758 static_cast<size_t>(init_data_length)); 759 static_cast<size_t>(init_data_length));
759 760
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 compositor_task_runner_->PostTask(FROM_HERE, 1373 compositor_task_runner_->PostTask(FROM_HERE,
1373 base::Bind(&GetCurrentFrameAndSignal, 1374 base::Bind(&GetCurrentFrameAndSignal,
1374 base::Unretained(compositor_), 1375 base::Unretained(compositor_),
1375 &video_frame, 1376 &video_frame,
1376 &event)); 1377 &event));
1377 event.Wait(); 1378 event.Wait();
1378 return video_frame; 1379 return video_frame;
1379 } 1380 }
1380 1381
1381 } // namespace content 1382 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698