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

Unified Diff: third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.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/ContentDecryptionModuleResultPromise.cpp
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp b/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp
index be1abd19c605bc18e2d28f602993143eeee36256..728f35442fb0954f16fb04d52a231c72b576ab1c 100644
--- a/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp
+++ b/third_party/WebKit/Source/modules/encryptedmedia/ContentDecryptionModuleResultPromise.cpp
@@ -71,13 +71,16 @@ void ContentDecryptionModuleResultPromise::completeWithError(WebContentDecryptio
// Non-zero |systemCode| is appended to the |errorMessage|. If the
// |errorMessage| is empty, we'll report "Rejected with system code
// (systemCode)".
- String errorString = errorMessage;
+ StringBuilder result;
+ result.append(errorMessage);
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(')');
}
- reject(WebCdmExceptionToExceptionCode(exceptionCode), errorString);
+ reject(WebCdmExceptionToExceptionCode(exceptionCode), result.toString());
}
ScriptPromise ContentDecryptionModuleResultPromise::promise()

Powered by Google App Engine
This is Rietveld 408576698