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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp

Issue 2235113002: Use StringView for String::append and ::insert. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix appendHex stuff. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
index 52588923c4af69de6ea096d251884c9fde495669..f0d2e39235a62274fb6bb8e5309ffc9167fd50d9 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
@@ -89,13 +89,16 @@ public:
{
// Non-zero |systemCode| is appended to the |message|. If the |message|
// is empty, we'll report "Rejected with system code (systemCode)".
- String errorString = message;
+ StringBuilder result;
+ result.append(message);
if (systemCode != 0) {
- if (errorString.isEmpty())
- errorString.append("Rejected with system code");
- errorString.append(" (" + String::number(systemCode) + ")");
+ if (result.isEmpty())
+ result.append("Rejected with system code");
+ result.append(" (");
+ result.appendNumber(systemCode);
+ result.append(')');
}
- (*m_failureCallback)(WebCdmExceptionToExceptionCode(code), errorString);
+ (*m_failureCallback)(WebCdmExceptionToExceptionCode(code), result.toString());
}
private:

Powered by Google App Engine
This is Rietveld 408576698