OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 V8ScriptValueDeserializerForModules_h | 5 #ifndef V8ScriptValueDeserializerForModules_h |
6 #define V8ScriptValueDeserializerForModules_h | 6 #define V8ScriptValueDeserializerForModules_h |
7 | 7 |
8 #include "bindings/core/v8/serialization/V8ScriptValueDeserializer.h" | 8 #include "bindings/core/v8/serialization/V8ScriptValueDeserializer.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class CryptoKey; | 13 class CryptoKey; |
14 | 14 |
15 // Extends V8ScriptValueSerializer with support for modules/ types. | 15 // Extends V8ScriptValueSerializer with support for modules/ types. |
16 class MODULES_EXPORT V8ScriptValueDeserializerForModules final | 16 class MODULES_EXPORT V8ScriptValueDeserializerForModules final |
17 : public V8ScriptValueDeserializer { | 17 : public V8ScriptValueDeserializer { |
18 public: | 18 public: |
19 explicit V8ScriptValueDeserializerForModules( | 19 explicit V8ScriptValueDeserializerForModules( |
20 RefPtr<ScriptState> scriptState, | 20 RefPtr<ScriptState> scriptState, |
21 RefPtr<SerializedScriptValue> serializedScriptValue) | 21 RefPtr<SerializedScriptValue> serializedScriptValue, |
22 : V8ScriptValueDeserializer(scriptState, serializedScriptValue) {} | 22 const Options& options = Options()) |
| 23 : V8ScriptValueDeserializer(scriptState, serializedScriptValue, options) { |
| 24 } |
23 | 25 |
24 protected: | 26 protected: |
25 ScriptWrappable* readDOMObject(SerializationTag) override; | 27 ScriptWrappable* readDOMObject(SerializationTag) override; |
26 | 28 |
27 private: | 29 private: |
28 bool readOneByte(uint8_t* byte) { | 30 bool readOneByte(uint8_t* byte) { |
29 const void* data; | 31 const void* data; |
30 if (!readRawBytes(1, &data)) | 32 if (!readRawBytes(1, &data)) |
31 return false; | 33 return false; |
32 *byte = *reinterpret_cast<const uint8_t*>(data); | 34 *byte = *reinterpret_cast<const uint8_t*>(data); |
33 return true; | 35 return true; |
34 } | 36 } |
35 CryptoKey* readCryptoKey(); | 37 CryptoKey* readCryptoKey(); |
36 }; | 38 }; |
37 | 39 |
38 } // namespace blink | 40 } // namespace blink |
39 | 41 |
40 #endif // V8ScriptValueDeserializerForModules_h | 42 #endif // V8ScriptValueDeserializerForModules_h |
OLD | NEW |