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 V8ScriptValueSerializerForModules_h | 5 #ifndef V8ScriptValueSerializerForModules_h |
6 #define V8ScriptValueSerializerForModules_h | 6 #define V8ScriptValueSerializerForModules_h |
7 | 7 |
8 #include "bindings/core/v8/serialization/V8ScriptValueSerializer.h" | 8 #include "bindings/core/v8/serialization/V8ScriptValueSerializer.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "public/platform/WebCryptoAlgorithm.h" | 10 #include "public/platform/WebCryptoAlgorithm.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class WebCryptoKey; | 14 class WebCryptoKey; |
15 | 15 |
16 // Extends V8ScriptValueSerializer with support for modules/ types. | 16 // Extends V8ScriptValueSerializer with support for modules/ types. |
17 class MODULES_EXPORT V8ScriptValueSerializerForModules final | 17 class MODULES_EXPORT V8ScriptValueSerializerForModules final |
18 : public V8ScriptValueSerializer { | 18 : public V8ScriptValueSerializer { |
19 public: | 19 public: |
20 explicit V8ScriptValueSerializerForModules(RefPtr<ScriptState> scriptState) | 20 explicit V8ScriptValueSerializerForModules( |
21 : V8ScriptValueSerializer(scriptState) {} | 21 RefPtr<ScriptState> scriptState, |
| 22 const SerializedScriptValue::SerializeOptions& options) |
| 23 : V8ScriptValueSerializer(scriptState, options) {} |
22 | 24 |
23 protected: | 25 protected: |
24 bool writeDOMObject(ScriptWrappable*, ExceptionState&) override; | 26 bool writeDOMObject(ScriptWrappable*, ExceptionState&) override; |
25 | 27 |
26 private: | 28 private: |
27 void writeOneByte(uint8_t byte) { writeRawBytes(&byte, 1); } | 29 void writeOneByte(uint8_t byte) { writeRawBytes(&byte, 1); } |
28 bool writeCryptoKey(const WebCryptoKey&, ExceptionState&); | 30 bool writeCryptoKey(const WebCryptoKey&, ExceptionState&); |
29 }; | 31 }; |
30 | 32 |
31 } // namespace blink | 33 } // namespace blink |
32 | 34 |
33 #endif // V8ScriptValueSerializerForModules_h | 35 #endif // V8ScriptValueSerializerForModules_h |
OLD | NEW |