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 SerializedScriptValueFactory_h | 5 #ifndef SerializedScriptValueFactory_h |
6 #define SerializedScriptValueFactory_h | 6 #define SerializedScriptValueFactory_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptValueSerializer.h" | 8 #include "bindings/core/v8/ScriptValueSerializer.h" |
9 #include "bindings/core/v8/SerializedScriptValue.h" | 9 #include "bindings/core/v8/SerializedScriptValue.h" |
10 #include "core/CoreExport.h" | 10 #include "core/CoreExport.h" |
| 11 #include "wtf/FastAllocBase.h" |
11 #include "wtf/Noncopyable.h" | 12 #include "wtf/Noncopyable.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 class CORE_EXPORT SerializedScriptValueFactory { | 16 class CORE_EXPORT SerializedScriptValueFactory { |
16 WTF_MAKE_NONCOPYABLE(SerializedScriptValueFactory); | 17 WTF_MAKE_NONCOPYABLE(SerializedScriptValueFactory); |
| 18 WTF_MAKE_FAST_ALLOCATED(SerializedScriptValueFactory); |
17 public: | 19 public: |
18 SerializedScriptValueFactory() { } | 20 SerializedScriptValueFactory() { } |
19 | 21 |
20 // If a serialization error occurs (e.g., cyclic input value) this | 22 // If a serialization error occurs (e.g., cyclic input value) this |
21 // function returns an empty representation, schedules a V8 exception to | 23 // function returns an empty representation, schedules a V8 exception to |
22 // be thrown using v8::ThrowException(), and sets |didThrow|. In this case | 24 // be thrown using v8::ThrowException(), and sets |didThrow|. In this case |
23 // the caller must not invoke any V8 operations until control returns to | 25 // the caller must not invoke any V8 operations until control returns to |
24 // V8. When serialization is successful, |didThrow| is false. | 26 // V8. When serialization is successful, |didThrow| is false. |
25 virtual PassRefPtr<SerializedScriptValue> create(v8::Isolate*, v8::Local<v8:
:Value>, MessagePortArray*, ArrayBufferArray*, WebBlobInfoArray*, ExceptionState
&); | 27 virtual PassRefPtr<SerializedScriptValue> create(v8::Isolate*, v8::Local<v8:
:Value>, MessagePortArray*, ArrayBufferArray*, WebBlobInfoArray*, ExceptionState
&); |
26 PassRefPtr<SerializedScriptValue> create(v8::Isolate*, v8::Local<v8::Value>,
MessagePortArray*, ArrayBufferArray*, ExceptionState&); | 28 PassRefPtr<SerializedScriptValue> create(v8::Isolate*, v8::Local<v8::Value>,
MessagePortArray*, ArrayBufferArray*, ExceptionState&); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 62 |
61 virtual v8::Local<v8::Value> deserialize(String& data, BlobDataHandleMap& bl
obDataHandles, ArrayBufferContentsArray*, v8::Isolate*, MessagePortArray* messag
ePorts, const WebBlobInfoArray*); | 63 virtual v8::Local<v8::Value> deserialize(String& data, BlobDataHandleMap& bl
obDataHandles, ArrayBufferContentsArray*, v8::Isolate*, MessagePortArray* messag
ePorts, const WebBlobInfoArray*); |
62 | 64 |
63 private: | 65 private: |
64 static SerializedScriptValueFactory* m_instance; | 66 static SerializedScriptValueFactory* m_instance; |
65 }; | 67 }; |
66 | 68 |
67 } // namespace blink | 69 } // namespace blink |
68 | 70 |
69 #endif // SerializedScriptValueFactory_h | 71 #endif // SerializedScriptValueFactory_h |
OLD | NEW |