| 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..3e40005a89fa63e70a37769fa077a81732616cbb
|
| --- /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)
|
| +{
|
| + SerializedScriptValueWriterForModules writer;
|
| + writer.writeWebCoreString(data);
|
| + String wireData = writer.takeWireString();
|
| + return createFromWire(wireData);
|
| +}
|
| +
|
| +PassRefPtr<SerializedScriptValue> SerializedScriptValueForModulesFactory::create()
|
| +{
|
| + return adoptRef(new SerializedScriptValueForModules());
|
| +}
|
| +
|
| +} // namespace blink
|
| +
|
|
|