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

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, 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
« 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/WebArrayBufferConverter.h b/public/web/WebCryptoNormalize.h
similarity index 69%
copy from public/web/WebArrayBufferConverter.h
copy to public/web/WebCryptoNormalize.h
index 5dc0d010c655ca3dd2d4246b9ffaf39b77887dda..16ad8042b946015361b15ad4516b7e19ed4a35a8 100644
--- a/public/web/WebArrayBufferConverter.h
+++ b/public/web/WebCryptoNormalize.h
@@ -28,30 +28,34 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebArrayBufferConverter_h
-#define WebArrayBufferConverter_h
+#ifndef WebCryptoNormalize_h
+#define WebCryptoNormalize_h
-#include "public/platform/WebArrayBuffer.h"
+#include "../platform/WebCommon.h"
+
+#include "../platform/WebCryptoAlgorithm.h"
namespace v8 {
class Isolate;
class Object;
-class Value;
template <class T> class Handle;
}
namespace blink {
-class WebArrayBufferConverter {
-public:
- // FIXME: remove these two APIs which doesn't take either context or
- // isolate as their parameters after the embedder side is fixed.
- BLINK_EXPORT static v8::Handle<v8::Value> toV8Value(WebArrayBuffer*);
- BLINK_EXPORT static WebArrayBuffer* createFromV8Value(v8::Handle<v8::Value>);
- BLINK_EXPORT static v8::Handle<v8::Value> toV8Value(WebArrayBuffer*, v8::Handle<v8::Object>, v8::Isolate*);
- BLINK_EXPORT static WebArrayBuffer* createFromV8Value(v8::Handle<v8::Value>, v8::Isolate*);
-};
+class WebString;
+
+// Converts a javascript Dictionary to a WebCryptoAlgorithm object.
abarth-chromium 2014/06/06 17:12:48 javascript -> JavaScript
+//
+// 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 WebCryptoAlgorithm normalizeCryptoAlgorithm(v8::Handle<v8::Object>, WebCryptoOperation, int* exceptionCode, WebString* errorDetails, v8::Isolate*);
} // namespace blink
-#endif // WebArrayBufferConverter_h
+#endif
« 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