OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "config.h" |
| 6 #include "bindings/modules/v8/SerializedScriptValueForModulesFactory.h" |
| 7 |
| 8 #include "bindings/core/v8/ExceptionState.h" |
| 9 #include "bindings/modules/v8/ScriptValueSerializerForModules.h" |
| 10 #include "bindings/modules/v8/SerializedScriptValueForModules.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create
(v8::Handle<v8::Value> value, MessagePortArray* messagePorts, ArrayBufferArray*
arrayBuffers, ExceptionState& exceptionState, v8::Isolate* isolate) |
| 15 { |
| 16 return adoptRef(new SerializedScriptValueForModules(value, messagePorts, arr
ayBuffers, 0, exceptionState, isolate)); |
| 17 } |
| 18 |
| 19 PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create
(const ScriptValue& value, WebBlobInfoArray* blobInfo, ExceptionState& exception
State, v8::Isolate* isolate) |
| 20 { |
| 21 ASSERT(isolate->InContext()); |
| 22 return adoptRef(new SerializedScriptValueForModules(value.v8Value(), 0, 0, b
lobInfo, exceptionState, isolate)); |
| 23 } |
| 24 |
| 25 PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create
FromWire(const String& data) |
| 26 { |
| 27 return adoptRef(new SerializedScriptValueForModules(data)); |
| 28 } |
| 29 |
| 30 PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create
(const String& data, v8::Isolate* isolate) |
| 31 { |
| 32 SerializedScriptValueWriterForModules writer; |
| 33 writer.writeWebCoreString(data); |
| 34 String wireData = writer.takeWireString(); |
| 35 return createFromWire(wireData); |
| 36 } |
| 37 |
| 38 PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create
() |
| 39 { |
| 40 return adoptRef(new SerializedScriptValueForModules()); |
| 41 } |
| 42 |
| 43 } // namespace blink |
| 44 |
OLD | NEW |