| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ScriptValueSerializerForModules_h | 5 #ifndef ScriptValueSerializerForModules_h |
| 6 #define ScriptValueSerializerForModules_h | 6 #define ScriptValueSerializerForModules_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptValueSerializer.h" | 8 #include "bindings/core/v8/ScriptValueSerializer.h" |
| 9 #include "public/platform/WebCrypto.h" | 9 #include "public/platform/WebCrypto.h" |
| 10 #include "public/platform/WebCryptoKey.h" | 10 #include "public/platform/WebCryptoKey.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 | 24 |
| 25 void writeDOMFileSystem(int type, const String& name, const String& url); | 25 void writeDOMFileSystem(int type, const String& name, const String& url); |
| 26 bool writeCryptoKey(const WebCryptoKey&); | 26 bool writeCryptoKey(const WebCryptoKey&); |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 void doWriteHmacKey(const WebCryptoKey&); | 29 void doWriteHmacKey(const WebCryptoKey&); |
| 30 void doWriteAesKey(const WebCryptoKey&); | 30 void doWriteAesKey(const WebCryptoKey&); |
| 31 void doWriteRsaHashedKey(const WebCryptoKey&); | 31 void doWriteRsaHashedKey(const WebCryptoKey&); |
| 32 void doWriteEcKey(const WebCryptoKey&); | 32 void doWriteEcKey(const WebCryptoKey&); |
| 33 void doWriteKdfKey(const WebCryptoKey&); |
| 33 void doWriteAlgorithmId(WebCryptoAlgorithmId); | 34 void doWriteAlgorithmId(WebCryptoAlgorithmId); |
| 34 void doWriteAsymmetricKeyType(WebCryptoKeyType); | 35 void doWriteAsymmetricKeyType(WebCryptoKeyType); |
| 35 void doWriteNamedCurve(WebCryptoNamedCurve); | 36 void doWriteNamedCurve(WebCryptoNamedCurve); |
| 36 void doWriteKeyUsages(const WebCryptoKeyUsageMask usages, bool extractable); | 37 void doWriteKeyUsages(const WebCryptoKeyUsageMask usages, bool extractable); |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 DEFINE_TYPE_CASTS(SerializedScriptValueWriterForModules, SerializedScriptValueWr
iter, writer, true, true); | 40 DEFINE_TYPE_CASTS(SerializedScriptValueWriterForModules, SerializedScriptValueWr
iter, writer, true, true); |
| 40 | 41 |
| 41 class SerializedScriptValueReaderForModules final : public SerializedScriptValue
Reader { | 42 class SerializedScriptValueReaderForModules final : public SerializedScriptValue
Reader { |
| 42 STACK_ALLOCATED(); | 43 STACK_ALLOCATED(); |
| 43 WTF_MAKE_NONCOPYABLE(SerializedScriptValueReaderForModules); | 44 WTF_MAKE_NONCOPYABLE(SerializedScriptValueReaderForModules); |
| 44 public: | 45 public: |
| 45 SerializedScriptValueReaderForModules(const uint8_t* buffer, int length, con
st WebBlobInfoArray* blobInfo, BlobDataHandleMap& blobDataHandles, ScriptState*
scriptState) | 46 SerializedScriptValueReaderForModules(const uint8_t* buffer, int length, con
st WebBlobInfoArray* blobInfo, BlobDataHandleMap& blobDataHandles, ScriptState*
scriptState) |
| 46 : SerializedScriptValueReader(buffer, length, blobInfo, blobDataHandles,
scriptState) | 47 : SerializedScriptValueReader(buffer, length, blobInfo, blobDataHandles,
scriptState) |
| 47 { | 48 { |
| 48 } | 49 } |
| 49 | 50 |
| 50 virtual bool read(v8::Handle<v8::Value>*, ScriptValueCompositeCreator&) over
ride; | 51 virtual bool read(v8::Handle<v8::Value>*, ScriptValueCompositeCreator&) over
ride; |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 bool readDOMFileSystem(v8::Handle<v8::Value>*); | 54 bool readDOMFileSystem(v8::Handle<v8::Value>*); |
| 54 bool readCryptoKey(v8::Handle<v8::Value>*); | 55 bool readCryptoKey(v8::Handle<v8::Value>*); |
| 55 bool doReadHmacKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 56 bool doReadHmacKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
| 56 bool doReadAesKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 57 bool doReadAesKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
| 57 bool doReadRsaHashedKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 58 bool doReadRsaHashedKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
| 58 bool doReadEcKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 59 bool doReadEcKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
| 60 bool doReadKdfKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
| 59 bool doReadAlgorithmId(WebCryptoAlgorithmId&); | 61 bool doReadAlgorithmId(WebCryptoAlgorithmId&); |
| 60 bool doReadAsymmetricKeyType(WebCryptoKeyType&); | 62 bool doReadAsymmetricKeyType(WebCryptoKeyType&); |
| 61 bool doReadNamedCurve(WebCryptoNamedCurve&); | 63 bool doReadNamedCurve(WebCryptoNamedCurve&); |
| 62 bool doReadKeyUsages(WebCryptoKeyUsageMask& usages, bool& extractable); | 64 bool doReadKeyUsages(WebCryptoKeyUsageMask& usages, bool& extractable); |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 DEFINE_TYPE_CASTS(SerializedScriptValueReaderForModules, SerializedScriptValueRe
ader, reader, true, true); | 67 DEFINE_TYPE_CASTS(SerializedScriptValueReaderForModules, SerializedScriptValueRe
ader, reader, true, true); |
| 66 | 68 |
| 67 class ScriptValueSerializerForModules final : public ScriptValueSerializer { | 69 class ScriptValueSerializerForModules final : public ScriptValueSerializer { |
| 68 STACK_ALLOCATED(); | 70 STACK_ALLOCATED(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 83 public: | 85 public: |
| 84 ScriptValueDeserializerForModules(SerializedScriptValueReaderForModules&, Me
ssagePortArray* messagePorts, ArrayBufferContentsArray*); | 86 ScriptValueDeserializerForModules(SerializedScriptValueReaderForModules&, Me
ssagePortArray* messagePorts, ArrayBufferContentsArray*); |
| 85 | 87 |
| 86 private: | 88 private: |
| 87 virtual bool read(v8::Local<v8::Value>*) override; | 89 virtual bool read(v8::Local<v8::Value>*) override; |
| 88 }; | 90 }; |
| 89 | 91 |
| 90 } // namespace blink | 92 } // namespace blink |
| 91 | 93 |
| 92 #endif // ScriptValueSerializerForModules_h | 94 #endif // ScriptValueSerializerForModules_h |
| OLD | NEW |