Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp

Issue 2011553008: [Binding] [Refactoring] Move some create() from SerializedScriptValueFactory to SerializedScriptValu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp
index 03781b5bb7b99a4813d8b4ef5fa012443a2508b8..6b69eae8bd0d1cab784c1388ab93b94d879f6f8a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp
@@ -19,7 +19,7 @@ SerializedScriptValueFactory* SerializedScriptValueFactory::m_instance = 0;
PassRefPtr<SerializedScriptValue> SerializedScriptValueFactory::create(v8::Isolate* isolate, v8::Local<v8::Value> value, SerializedScriptValueWriter& writer, Transferables* transferables, WebBlobInfoArray* blobInfo, ExceptionState& exceptionState)
{
- RefPtr<SerializedScriptValue> serializedValue = create();
+ RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::create();
ScriptValueSerializer::Status status;
String errorMessage;
{
@@ -70,42 +70,12 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValueFactory::create(v8::Isola
return create(isolate, value.v8Value(), nullptr, blobInfo, exceptionState);
}
-PassRefPtr<SerializedScriptValue> SerializedScriptValueFactory::createFromWire(const String& data)
-{
- return adoptRef(new SerializedScriptValue(data));
-}
-
-PassRefPtr<SerializedScriptValue> SerializedScriptValueFactory::createFromWireBytes(const char* data, size_t length)
-{
- // Decode wire data from big endian to host byte order.
- ASSERT(!(length % sizeof(UChar)));
- size_t stringLength = length / sizeof(UChar);
- StringBuffer<UChar> buffer(stringLength);
- const UChar* src = reinterpret_cast<const UChar*>(data);
- UChar* dst = buffer.characters();
- for (size_t i = 0; i < stringLength; i++)
- dst[i] = ntohs(src[i]);
-
- return createFromWire(String::adopt(buffer));
-}
-
PassRefPtr<SerializedScriptValue> SerializedScriptValueFactory::create(const String& data)
{
- return create(v8::Isolate::GetCurrent(), data);
-}
-
-PassRefPtr<SerializedScriptValue> SerializedScriptValueFactory::create(v8::Isolate* isolate, const String& data)
-{
- ASSERT_NOT_REACHED();
SerializedScriptValueWriter writer;
writer.writeWebCoreString(data);
String wireData = writer.takeWireString();
- return createFromWire(wireData);
-}
-
-PassRefPtr<SerializedScriptValue> SerializedScriptValueFactory::create()
-{
- return adoptRef(new SerializedScriptValue());
+ return SerializedScriptValue::create(wireData);
}
void SerializedScriptValueFactory::transferData(SerializedScriptValue* serializedValue, SerializedScriptValueWriter& writer, Transferables* transferables, ExceptionState& exceptionState, v8::Isolate* isolate)

Powered by Google App Engine
This is Rietveld 408576698