RESOLVED FIXED 123216
Add CryptoKey base class and bindings
https://bugs.webkit.org/show_bug.cgi?id=123216
Summary Add CryptoKey base class and bindings
Alexey Proskuryakov
Reported 2013-10-23 13:41:54 PDT
Add CryptoKey base class and bindings.
Attachments
proposed patch (33.14 KB, patch)
2013-10-23 13:57 PDT, Alexey Proskuryakov
no flags
with release build fix (32.55 KB, patch)
2013-10-23 14:27 PDT, Alexey Proskuryakov
sam: review+
Alexey Proskuryakov
Comment 1 2013-10-23 13:57:40 PDT
Created attachment 214994 [details] proposed patch
Alexey Proskuryakov
Comment 2 2013-10-23 14:27:37 PDT
Created attachment 214997 [details] with release build fix
Sam Weinig
Comment 3 2013-10-23 20:44:49 PDT
Comment on attachment 214997 [details] with release build fix View in context: https://bugs.webkit.org/attachment.cgi?id=214997&action=review r=me > Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.h:49 > + JSC::ExecState* m_exec; It might be slightly more efficient to store a VM& here. I think everything except perhaps constructEmptyObject has an override that takes a VM& or VM*. > Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.h:50 > + JSC::Strong<JSC::JSObject> m_dictionary; If this is only ever used on the stack, does this have to be a Strong?
Alexey Proskuryakov
Comment 4 2013-10-23 22:05:57 PDT
> It might be slightly more efficient to store a VM& here. I think everything except perhaps constructEmptyObject has an override that takes a VM& or VM*. Yes, I started with VM, but had to switch to ExecState because I'll need to call constructEmptyObject again for nested dictionaries (it's not in the patch right now). > If this is only ever used on the stack, does this have to be a Strong? Good point, I copied it from elsewhere thoughtlessly.
Alexey Proskuryakov
Comment 5 2013-10-24 10:04:09 PDT
Darin Adler
Comment 6 2013-10-24 10:14:20 PDT
Comment on attachment 214997 [details] with release build fix View in context: https://bugs.webkit.org/attachment.cgi?id=214997&action=review > Source/WebCore/bindings/js/JSCryptoAlgorithmBuilder.h:45 > + virtual void add(const char*, unsigned long) OVERRIDE; Why “unsigned long” instead of unsigned?
Alexey Proskuryakov
Comment 7 2013-10-24 10:24:44 PDT
> Why “unsigned long” instead of unsigned? This is for adding dictionary items that are marked "unsigned long" in IDL, what should this map to in C++ code? In practice, key length could as well be 16 bit: dictionary HmacKeyParams : Algorithm { // The inner hash function to use. AlgorithmIdentifier hash; // The length (in bytes) of the key to generate. If unspecified, the // recommended length will be used, which is the size of the associated hash function's block // size. unsigned long length?; };
Darin Adler
Comment 8 2013-10-24 10:31:44 PDT
(In reply to comment #7) > > Why “unsigned long” instead of unsigned? > > This is for adding dictionary items that are marked "unsigned long" in IDL, what should this map to in C++ code? unsigned. I know, it’s not obvious.
Note You need to log in before you can comment on or make changes to this bug.