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

Unified Diff: Source/modules/crypto/SubtleCrypto.h

Issue 267133002: [webcrypto] Allow both ArrayBuffer and ArrayBufferView as inputs to crypto.subtle methods. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove buffer check 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: Source/modules/crypto/SubtleCrypto.h
diff --git a/Source/modules/crypto/SubtleCrypto.h b/Source/modules/crypto/SubtleCrypto.h
index 830cdc7bd07818b826b4a41476409a38749fe5d9..5ee7f221758c4e181c4386964ed2633f494a625f 100644
--- a/Source/modules/crypto/SubtleCrypto.h
+++ b/Source/modules/crypto/SubtleCrypto.h
@@ -34,6 +34,7 @@
#include "bindings/v8/ScriptPromise.h"
#include "bindings/v8/ScriptWrappable.h"
#include "platform/heap/Handle.h"
+#include "wtf/ArrayBytes.h"
#include "wtf/Forward.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
@@ -43,26 +44,26 @@ namespace WebCore {
class Dictionary;
class Key;
-class SubtleCrypto : public GarbageCollectedFinalized<SubtleCrypto>, public ScriptWrappable {
+class SubtleCrypto : public GarbageCollectedFinalized<SubtleCrypto>, public ScriptWrappable {
public:
static SubtleCrypto* create()
{
return new SubtleCrypto();
}
- ScriptPromise encrypt(const Dictionary&, Key*, ArrayBufferView* data);
- ScriptPromise decrypt(const Dictionary&, Key*, ArrayBufferView* data);
- ScriptPromise sign(const Dictionary&, Key*, ArrayBufferView* data);
+ ScriptPromise encrypt(const Dictionary&, Key*, const ArrayBytes&);
+ ScriptPromise decrypt(const Dictionary&, Key*, const ArrayBytes&);
+ ScriptPromise sign(const Dictionary&, Key*, const ArrayBytes&);
// Note that this is not named "verify" because when compiling on Mac that expands to a macro and breaks.
- ScriptPromise verifySignature(const Dictionary&, Key*, ArrayBufferView* signature, ArrayBufferView* data);
- ScriptPromise digest(const Dictionary&, ArrayBufferView* data);
+ ScriptPromise verifySignature(const Dictionary&, Key*, const ArrayBytes& signature, const ArrayBytes& data);
+ ScriptPromise digest(const Dictionary&, const ArrayBytes& data);
ScriptPromise generateKey(const Dictionary&, bool extractable, const Vector<String>& keyUsages);
- ScriptPromise importKey(const String&, ArrayBufferView*, const Dictionary&, bool extractable, const Vector<String>& keyUsages);
+ ScriptPromise importKey(const String&, const ArrayBytes&, const Dictionary&, bool extractable, const Vector<String>& keyUsages);
ScriptPromise exportKey(const String&, Key*);
ScriptPromise wrapKey(const String&, Key*, Key*, const Dictionary&);
- ScriptPromise unwrapKey(const String&, ArrayBufferView*, Key*, const Dictionary&, const Dictionary&, bool, const Vector<String>&);
+ ScriptPromise unwrapKey(const String&, const ArrayBytes&, Key*, const Dictionary&, const Dictionary&, bool, const Vector<String>&);
void trace(Visitor*) { }

Powered by Google App Engine
This is Rietveld 408576698