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

Unified Diff: public/web/WebScriptBindings.h

Issue 295423004: Expose WebCrypto's algorithm normalization. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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: public/web/WebScriptBindings.h
diff --git a/public/web/WebScriptBindings.h b/public/web/WebScriptBindings.h
index ef953b659e6aec6d284dcd47e659781e20ff94b1..64764fffca72a81eaa1685f9dd670e6720323a2d 100644
--- a/public/web/WebScriptBindings.h
+++ b/public/web/WebScriptBindings.h
@@ -32,9 +32,11 @@
#define WebScriptBindings_h
#include "../platform/WebCommon.h"
+#include "../platform/WebCryptoAlgorithmOperation.h"
namespace v8 {
class Isolate;
+class Object;
class String;
template <class T> class Handle;
template <class T> class Local;
@@ -43,6 +45,7 @@ template <class T> class Local;
namespace blink {
class WebString;
+class WebCryptoAlgorithm;
class WebScriptBindings {
public:
@@ -52,6 +55,16 @@ public:
// You can use v8::Value::toString() to get a v8::String, but remember to wrap that in a v8::TryCatch.
BLINK_EXPORT static WebString toWebString(v8::Handle<v8::String>);
+
+ // Converts a javascript Dictionary to a WebCryptoAlgorithm object.
+ //
+ // This corresponds with "normalizing" [1] the algorithm, and then validating
+ // the expected parameters for the algorithm/operation combination.
+ //
+ // On failure returns an null WebCryptoAlgorithm, sets the int to the ExceptionCode and the WebString to a (non-localized) debug string.
+ //
+ // [1] http://www.w3.org/TR/WebCryptoAPI/#algorithm-normalizing-rules
+ BLINK_EXPORT static WebCryptoAlgorithm normalizeCryptoAlgorithm(v8::Handle<v8::Object>, AlgorithmOperation, int*, WebString*, v8::Isolate*);
};
} // namespace blink
« Source/web/WebScriptBindings.cpp ('K') | « public/platform/WebCryptoAlgorithmOperation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698