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 30 matching lines...) Expand all Loading... |
41 | 41 |
42 class SerializedScriptValueReaderForModules final : public SerializedScriptValue
Reader { | 42 class SerializedScriptValueReaderForModules final : public SerializedScriptValue
Reader { |
43 STACK_ALLOCATED(); | 43 STACK_ALLOCATED(); |
44 WTF_MAKE_NONCOPYABLE(SerializedScriptValueReaderForModules); | 44 WTF_MAKE_NONCOPYABLE(SerializedScriptValueReaderForModules); |
45 public: | 45 public: |
46 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) |
47 : SerializedScriptValueReader(buffer, length, blobInfo, blobDataHandles,
scriptState) | 47 : SerializedScriptValueReader(buffer, length, blobInfo, blobDataHandles,
scriptState) |
48 { | 48 { |
49 } | 49 } |
50 | 50 |
51 virtual bool read(v8::Local<v8::Value>*, ScriptValueCompositeCreator&) overr
ide; | 51 bool read(v8::Local<v8::Value>*, ScriptValueCompositeCreator&) override; |
52 | 52 |
53 private: | 53 private: |
54 bool readDOMFileSystem(v8::Local<v8::Value>*); | 54 bool readDOMFileSystem(v8::Local<v8::Value>*); |
55 bool readCryptoKey(v8::Local<v8::Value>*); | 55 bool readCryptoKey(v8::Local<v8::Value>*); |
56 bool doReadHmacKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 56 bool doReadHmacKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
57 bool doReadAesKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 57 bool doReadAesKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
58 bool doReadRsaHashedKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 58 bool doReadRsaHashedKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
59 bool doReadEcKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 59 bool doReadEcKey(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
60 bool doReadKeyWithoutParams(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); | 60 bool doReadKeyWithoutParams(WebCryptoKeyAlgorithm&, WebCryptoKeyType&); |
61 bool doReadAlgorithmId(WebCryptoAlgorithmId&); | 61 bool doReadAlgorithmId(WebCryptoAlgorithmId&); |
62 bool doReadAsymmetricKeyType(WebCryptoKeyType&); | 62 bool doReadAsymmetricKeyType(WebCryptoKeyType&); |
63 bool doReadNamedCurve(WebCryptoNamedCurve&); | 63 bool doReadNamedCurve(WebCryptoNamedCurve&); |
64 bool doReadKeyUsages(WebCryptoKeyUsageMask& usages, bool& extractable); | 64 bool doReadKeyUsages(WebCryptoKeyUsageMask& usages, bool& extractable); |
65 }; | 65 }; |
66 | 66 |
67 DEFINE_TYPE_CASTS(SerializedScriptValueReaderForModules, SerializedScriptValueRe
ader, reader, true, true); | 67 DEFINE_TYPE_CASTS(SerializedScriptValueReaderForModules, SerializedScriptValueRe
ader, reader, true, true); |
68 | 68 |
69 class ScriptValueSerializerForModules final : public ScriptValueSerializer { | 69 class ScriptValueSerializerForModules final : public ScriptValueSerializer { |
70 STACK_ALLOCATED(); | 70 STACK_ALLOCATED(); |
71 WTF_MAKE_NONCOPYABLE(ScriptValueSerializerForModules); | 71 WTF_MAKE_NONCOPYABLE(ScriptValueSerializerForModules); |
72 public: | 72 public: |
73 ScriptValueSerializerForModules(SerializedScriptValueWriter&, MessagePortArr
ay* messagePorts, ArrayBufferArray* arrayBuffers, WebBlobInfoArray*, BlobDataHan
dleMap& blobDataHandles, v8::TryCatch&, ScriptState*); | 73 ScriptValueSerializerForModules(SerializedScriptValueWriter&, MessagePortArr
ay* messagePorts, ArrayBufferArray* arrayBuffers, WebBlobInfoArray*, BlobDataHan
dleMap& blobDataHandles, v8::TryCatch&, ScriptState*); |
74 | 74 |
75 private: | 75 private: |
76 virtual ScriptValueSerializer::StateBase* doSerializeValue(v8::Local<v8::Val
ue>, ScriptValueSerializer::StateBase* next) override; | 76 ScriptValueSerializer::StateBase* doSerializeValue(v8::Local<v8::Value>, Scr
iptValueSerializer::StateBase* next) override; |
77 | 77 |
78 ScriptValueSerializer::StateBase* writeDOMFileSystem(v8::Local<v8::Value>, S
criptValueSerializer::StateBase* next); | 78 ScriptValueSerializer::StateBase* writeDOMFileSystem(v8::Local<v8::Value>, S
criptValueSerializer::StateBase* next); |
79 bool writeCryptoKey(v8::Local<v8::Value>); | 79 bool writeCryptoKey(v8::Local<v8::Value>); |
80 }; | 80 }; |
81 | 81 |
82 class ScriptValueDeserializerForModules final : public ScriptValueDeserializer { | 82 class ScriptValueDeserializerForModules final : public ScriptValueDeserializer { |
83 STACK_ALLOCATED(); | 83 STACK_ALLOCATED(); |
84 WTF_MAKE_NONCOPYABLE(ScriptValueDeserializerForModules); | 84 WTF_MAKE_NONCOPYABLE(ScriptValueDeserializerForModules); |
85 public: | 85 public: |
86 ScriptValueDeserializerForModules(SerializedScriptValueReaderForModules&, Me
ssagePortArray* messagePorts, ArrayBufferContentsArray*); | 86 ScriptValueDeserializerForModules(SerializedScriptValueReaderForModules&, Me
ssagePortArray* messagePorts, ArrayBufferContentsArray*); |
87 | 87 |
88 private: | 88 private: |
89 virtual bool read(v8::Local<v8::Value>*) override; | 89 bool read(v8::Local<v8::Value>*) override; |
90 }; | 90 }; |
91 | 91 |
92 } // namespace blink | 92 } // namespace blink |
93 | 93 |
94 #endif // ScriptValueSerializerForModules_h | 94 #endif // ScriptValueSerializerForModules_h |
OLD | NEW |