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 a1cf3967eac7c0cfaf79442f1833ee7c84e69cf8..5e2d7c5293820c4022e23d9ea46fa23569c29be2 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValueFactory.cpp |
@@ -55,20 +55,17 @@ v8::Local<v8::Value> SerializedScriptValueFactory::deserialize( |
// in |this| being destroyed. Holding a RefPtr ensures we are alive (along |
// with our internal data) throughout the operation. |
RefPtr<SerializedScriptValue> protect(value); |
- String& data = value->data(); |
- if (!data.impl()) |
+ if (!value->dataLengthInBytes()) |
return v8::Null(isolate); |
static_assert(sizeof(SerializedScriptValueWriter::BufferValueType) == 2, |
"BufferValueType should be 2 bytes"); |
- data.ensure16Bit(); |
// FIXME: SerializedScriptValue shouldn't use String for its underlying |
// storage. Instead, it should use SharedBuffer or Vector<uint8_t>. The |
// information stored in m_data isn't even encoded in UTF-16. Instead, |
// unicode characters are encoded as UTF-8 with two code units per UChar. |
- SerializedScriptValueReader reader( |
- reinterpret_cast<const uint8_t*>(data.impl()->characters16()), |
- 2 * data.length(), blobInfo, value->blobDataHandles(), |
- ScriptState::current(isolate)); |
+ SerializedScriptValueReader reader(value->data(), value->dataLengthInBytes(), |
+ blobInfo, value->blobDataHandles(), |
+ ScriptState::current(isolate)); |
ScriptValueDeserializer deserializer(reader, messagePorts, |
value->getArrayBufferContentsArray(), |
value->getImageBitmapContentsArray()); |