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

Unified Diff: media/blink/webcontentdecryptionmodulesession_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
« no previous file with comments | « media/blink/key_system_config_selector.cc ('k') | media/blink/webencryptedmediaclient_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webcontentdecryptionmodulesession_impl.cc
diff --git a/media/blink/webcontentdecryptionmodulesession_impl.cc b/media/blink/webcontentdecryptionmodulesession_impl.cc
index 3bef8a969952f6e2e54106896293401f16877dac..ab138e7447d95a9786b94b88895939907fe4ab60 100644
--- a/media/blink/webcontentdecryptionmodulesession_impl.cc
+++ b/media/blink/webcontentdecryptionmodulesession_impl.cc
@@ -168,11 +168,10 @@ static bool SanitizeSessionId(const blink::WebString& session_id,
// The user agent should thoroughly validate the sessionId value before
// passing it to the CDM. At a minimum, this should include checking that
// the length and value (e.g. alphanumeric) are reasonable.
- if (!base::IsStringASCII(session_id))
+ if (!session_id.containsOnlyASCII())
return false;
- sanitized_session_id->assign(
- base::UTF16ToASCII(base::StringPiece16(session_id)));
+ sanitized_session_id->assign(session_id.ascii());
if (sanitized_session_id->length() > limits::kMaxSessionIdLength)
return false;
« no previous file with comments | « media/blink/key_system_config_selector.cc ('k') | media/blink/webencryptedmediaclient_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698