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

Unified Diff: public/web/WebCryptoNormalize.h

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, 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
« no previous file with comments | « public/platform/WebCryptoAlgorithm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebCryptoNormalize.h
diff --git a/public/web/WebScriptBindings.h b/public/web/WebCryptoNormalize.h
similarity index 68%
copy from public/web/WebScriptBindings.h
copy to public/web/WebCryptoNormalize.h
index ef953b659e6aec6d284dcd47e659781e20ff94b1..fc4096810d94c491283eba413e68289a9dfd1db0 100644
--- a/public/web/WebScriptBindings.h
+++ b/public/web/WebCryptoNormalize.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
+ * Copyright (C) 2014 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,31 +28,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebScriptBindings_h
-#define WebScriptBindings_h
+#ifndef WebCryptoNormalize_h
+#define WebCryptoNormalize_h
#include "../platform/WebCommon.h"
+#include "public/platform/WebCryptoAlgorithm.h"
jochen (gone - plz use gerrit) 2014/06/06 06:58:22 ../platform
pneubeck (no reviews) 2014/06/06 09:17:09 Done.
+
namespace v8 {
class Isolate;
-class String;
+class Object;
template <class T> class Handle;
-template <class T> class Local;
}
namespace blink {
class WebString;
-class WebScriptBindings {
-public:
- // Efficiently converts a WebString to a v8::String. The caller must have
- // a HandleScope to guard the result's lifetime.
- BLINK_EXPORT static v8::Local<v8::String> toV8String(const WebString&, v8::Isolate*);
-
- // 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_PLATFORM_EXPORT WebCryptoAlgorithm normalizeCryptoAlgorithm(v8::Handle<v8::Object>, WebCryptoOperation, int* exceptionCode, WebString* errorDetails, v8::Isolate*);
jochen (gone - plz use gerrit) 2014/06/06 06:58:23 should be BLINK_EXPORT
pneubeck (no reviews) 2014/06/06 09:17:09 Done.
} // namespace blink
« no previous file with comments | « public/platform/WebCryptoAlgorithm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698