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

Unified Diff: Source/modules/crypto/CryptoResultImpl.cpp

Issue 295423004: Expose WebCrypto's algorithm normalization. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed comments. Created 6 years, 6 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: Source/modules/crypto/CryptoResultImpl.cpp
diff --git a/Source/modules/crypto/CryptoResultImpl.cpp b/Source/modules/crypto/CryptoResultImpl.cpp
index 9f7d4324fc01f1419ea451107a90dc6c16ed3a38..3870fa7f9f5ac5597718894e163be1e004990d13 100644
--- a/Source/modules/crypto/CryptoResultImpl.cpp
+++ b/Source/modules/crypto/CryptoResultImpl.cpp
@@ -47,9 +47,7 @@
namespace WebCore {
-namespace {
-
-ExceptionCode toExceptionCode(blink::WebCryptoErrorType errorType)
+ExceptionCode webCryptoErrorToExceptionCode(blink::WebCryptoErrorType errorType)
{
switch (errorType) {
case blink::WebCryptoErrorTypeNotSupported:
@@ -77,8 +75,6 @@ ExceptionCode toExceptionCode(blink::WebCryptoErrorType errorType)
return 0;
}
-} // namespace
-
// The PromiseState class contains all the state which is tied to an
// ExecutionContext. Whereas CryptoResultImpl can be deleted from any thread,
// PromiseState is not thread safe and must only be accessed and deleted from
@@ -109,7 +105,7 @@ public:
void completeWithError(blink::WebCryptoErrorType errorType, const blink::WebString& errorDetails)
{
- m_promiseResolver->reject(DOMException::create(toExceptionCode(errorType), errorDetails));
+ m_promiseResolver->reject(DOMException::create(webCryptoErrorToExceptionCode(errorType), errorDetails));
delete this;
}

Powered by Google App Engine
This is Rietveld 408576698