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

Unified Diff: media/blink/webencryptedmediaclient_impl.cc

Issue 2469353003: Skip base::string16 if not necessary for WebString <-> ASCII conversion (Closed)
Patch Set: minor fix Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: media/blink/webencryptedmediaclient_impl.cc
diff --git a/media/blink/webencryptedmediaclient_impl.cc b/media/blink/webencryptedmediaclient_impl.cc
index 8a1564bbe9859dd52eedef787efa7e8bb16c06bd..6b3e8949884f521f8a29d7e3eed8eb2999852fda 100644
--- a/media/blink/webencryptedmediaclient_impl.cc
+++ b/media/blink/webencryptedmediaclient_impl.cc
@@ -167,8 +167,8 @@ WebEncryptedMediaClientImpl::Reporter* WebEncryptedMediaClientImpl::GetReporter(
// Assumes that empty will not be found by GetKeySystemNameForUMA().
// TODO(sandersd): Avoid doing ASCII conversion more than once.
std::string key_system_ascii;
- if (base::IsStringASCII(key_system))
- key_system_ascii = base::UTF16ToASCII(base::StringPiece16(key_system));
+ if (key_system.containsOnlyASCII())
+ key_system_ascii = key_system.ascii();
// Return a per-frame singleton so that UMA reports will be once-per-frame.
std::string uma_name = GetKeySystemNameForUMA(key_system_ascii);
« no previous file with comments | « media/blink/webcontentdecryptionmodulesession_impl.cc ('k') | third_party/WebKit/Source/platform/exported/WebString.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698