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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1259673002: Make UTF16ToASCII and UTF16TOUTF8 take a StringPiece (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
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/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 } 1436 }
1437 #endif 1437 #endif
1438 1438
1439 // The following EME related code is copied from WebMediaPlayerImpl. 1439 // The following EME related code is copied from WebMediaPlayerImpl.
1440 // TODO(xhwang): Remove duplicate code between WebMediaPlayerAndroid and 1440 // TODO(xhwang): Remove duplicate code between WebMediaPlayerAndroid and
1441 // WebMediaPlayerImpl. 1441 // WebMediaPlayerImpl.
1442 1442
1443 // Convert a WebString to ASCII, falling back on an empty string in the case 1443 // Convert a WebString to ASCII, falling back on an empty string in the case
1444 // of a non-ASCII string. 1444 // of a non-ASCII string.
1445 static std::string ToASCIIOrEmpty(const blink::WebString& string) { 1445 static std::string ToASCIIOrEmpty(const blink::WebString& string) {
1446 return base::IsStringASCII(string) ? base::UTF16ToASCII(string) 1446 return base::IsStringASCII(string)
1447 : std::string(); 1447 ? base::UTF16ToASCII(base::StringPiece16(string))
1448 : std::string();
1448 } 1449 }
1449 1450
1450 // Helper functions to report media EME related stats to UMA. They follow the 1451 // Helper functions to report media EME related stats to UMA. They follow the
1451 // convention of more commonly used macros UMA_HISTOGRAM_ENUMERATION and 1452 // convention of more commonly used macros UMA_HISTOGRAM_ENUMERATION and
1452 // UMA_HISTOGRAM_COUNTS. The reason that we cannot use those macros directly is 1453 // UMA_HISTOGRAM_COUNTS. The reason that we cannot use those macros directly is
1453 // that UMA_* macros require the names to be constant throughout the process' 1454 // that UMA_* macros require the names to be constant throughout the process'
1454 // lifetime. 1455 // lifetime.
1455 1456
1456 static void EmeUMAHistogramEnumeration(const std::string& key_system, 1457 static void EmeUMAHistogramEnumeration(const std::string& key_system,
1457 const std::string& method, 1458 const std::string& method,
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1889 1890
1890 bool is_hls = IsHLSStream(); 1891 bool is_hls = IsHLSStream();
1891 UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", is_hls); 1892 UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", is_hls);
1892 if (is_hls) { 1893 if (is_hls) {
1893 media::RecordOriginOfHLSPlayback( 1894 media::RecordOriginOfHLSPlayback(
1894 GURL(frame_->document().securityOrigin().toString())); 1895 GURL(frame_->document().securityOrigin().toString()));
1895 } 1896 }
1896 } 1897 }
1897 1898
1898 } // namespace content 1899 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/clipboard_utils.cc ('k') | content/renderer/media/media_stream_renderer_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698