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

Unified Diff: public/platform/WebCrypto.h

Issue 141413003: [webcrypto] Match the error handling defined by the spec. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 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
« no previous file with comments | « Source/modules/crypto/SubtleCrypto.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebCrypto.h
diff --git a/public/platform/WebCrypto.h b/public/platform/WebCrypto.h
index 05d458f89c7bf3df7bd5111721c7a0c8e61c1df6..00806d372d4b05f5eebe42b9a9c340fe7e684a70 100644
--- a/public/platform/WebCrypto.h
+++ b/public/platform/WebCrypto.h
@@ -44,6 +44,7 @@ namespace WTF { template <typename T> class PassRefPtr; }
namespace blink {
class WebArrayBuffer;
+class WebString;
class WebCryptoResult {
public:
@@ -64,6 +65,15 @@ public:
}
BLINK_EXPORT void completeWithError();
+
+ // Note that WebString is NOT safe to pass across threads.
+ //
+ // Error details are intended to be displayed to developers for debugging.
+ // They MUST NEVER reveal any secret information such as bytes of the key
+ // or plain text. An appropriate error would be something like:
+ // "iv must be 16 bytes long".
+ BLINK_EXPORT void completeWithError(const WebString&);
+
// Note that WebArrayBuffer is NOT safe to create from another thread.
BLINK_EXPORT void completeWithBuffer(const WebArrayBuffer&);
// Makes a copy of the input data given as a pointer and byte length.
@@ -85,7 +95,8 @@ private:
class WebCrypto {
public:
- // WebCrypto is the interface for starting one-shot cryptographic operations.
+ // WebCrypto is the interface for starting one-shot cryptographic
+ // operations.
//
// -----------------------
// Completing the request
« no previous file with comments | « Source/modules/crypto/SubtleCrypto.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698