Chromium Code Reviews| Index: Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp |
| diff --git a/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp b/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4dc2775592150f7131bb12e0fe78c5ee5f7c1548 |
| --- /dev/null |
| +++ b/Source/bindings/modules/v8/SerializedScriptValueForModulesFactory.cpp |
| @@ -0,0 +1,44 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "config.h" |
| +#include "bindings/modules/v8/SerializedScriptValueForModulesFactory.h" |
| + |
| +#include "bindings/core/v8/ExceptionState.h" |
| +#include "bindings/modules/v8/ScriptValueSerializerForModules.h" |
| +#include "bindings/modules/v8/SerializedScriptValueForModules.h" |
| + |
| +namespace blink { |
| + |
| +PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create(v8::Handle<v8::Value> value, MessagePortArray* messagePorts, ArrayBufferArray* arrayBuffers, ExceptionState& exceptionState, v8::Isolate* isolate) |
| +{ |
| + return adoptRef(new SerializedScriptValueForModules(value, messagePorts, arrayBuffers, 0, exceptionState, isolate)); |
| +} |
| + |
| +PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create(const ScriptValue& value, WebBlobInfoArray* blobInfo, ExceptionState& exceptionState, v8::Isolate* isolate) |
| +{ |
| + ASSERT(isolate->InContext()); |
| + return adoptRef(new SerializedScriptValueForModules(value.v8Value(), 0, 0, blobInfo, exceptionState, isolate)); |
| +} |
| + |
| +PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::createFromWire(const String& data) |
| +{ |
| + return adoptRef(new SerializedScriptValueForModules(data)); |
| +} |
| + |
| +PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create(const String& data, v8::Isolate* isolate) |
| +{ |
| + SerializedScriptValueInternal::WriterForModules writer; |
|
haraken
2014/11/17 01:27:50
I wonder why you need a SerializedScriptValueInter
tasak
2014/11/17 08:42:30
Done.
|
| + writer.writeWebCoreString(data); |
| + String wireData = writer.takeWireString(); |
| + return createFromWire(wireData); |
| +} |
| + |
| +PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create() |
| +{ |
| + return adoptRef(new SerializedScriptValueForModules()); |
| +} |
| + |
| +} // namespace blink |
| + |