Index: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp |
index a92736be05aafd9662f21def37a4348b7c33ccf3..2efbe5305fd9290cee6d0b713afee581c9147964 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp |
@@ -1657,7 +1657,7 @@ |
return !value->IsEmpty(); |
} |
-DOMArrayBuffer* SerializedScriptValueReader::doReadArrayBuffer() |
+PassRefPtr<DOMArrayBuffer> SerializedScriptValueReader::doReadArrayBuffer() |
{ |
uint32_t byteLength; |
if (!doReadUint32(&byteLength)) |
@@ -1671,10 +1671,10 @@ |
bool SerializedScriptValueReader::readArrayBuffer(v8::Local<v8::Value>* value) |
{ |
- DOMArrayBuffer* arrayBuffer = doReadArrayBuffer(); |
+ RefPtr<DOMArrayBuffer> arrayBuffer = doReadArrayBuffer(); |
if (!arrayBuffer) |
return false; |
- *value = toV8(arrayBuffer, m_scriptState->context()->Global(), isolate()); |
+ *value = toV8(arrayBuffer.release(), m_scriptState->context()->Global(), isolate()); |
return !value->IsEmpty(); |
} |
@@ -1683,7 +1683,7 @@ |
ArrayBufferViewSubTag subTag; |
uint32_t byteOffset; |
uint32_t byteLength; |
- DOMArrayBufferBase* arrayBuffer = nullptr; |
+ RefPtr<DOMArrayBufferBase> arrayBuffer; |
v8::Local<v8::Value> arrayBufferV8Value; |
if (!readArrayBufferViewSubTag(&subTag)) |
return false; |
@@ -1753,34 +1753,34 @@ |
v8::Local<v8::Object> creationContext = m_scriptState->context()->Global(); |
switch (subTag) { |
case ByteArrayTag: |
- *value = toV8(DOMInt8Array::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMInt8Array::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case UnsignedByteArrayTag: |
- *value = toV8(DOMUint8Array::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMUint8Array::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case UnsignedByteClampedArrayTag: |
- *value = toV8(DOMUint8ClampedArray::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMUint8ClampedArray::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case ShortArrayTag: |
- *value = toV8(DOMInt16Array::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMInt16Array::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case UnsignedShortArrayTag: |
- *value = toV8(DOMUint16Array::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMUint16Array::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case IntArrayTag: |
- *value = toV8(DOMInt32Array::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMInt32Array::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case UnsignedIntArrayTag: |
- *value = toV8(DOMUint32Array::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMUint32Array::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case FloatArrayTag: |
- *value = toV8(DOMFloat32Array::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMFloat32Array::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case DoubleArrayTag: |
- *value = toV8(DOMFloat64Array::create(arrayBuffer, byteOffset, numElements), creationContext, isolate()); |
+ *value = toV8(DOMFloat64Array::create(arrayBuffer.release(), byteOffset, numElements), creationContext, isolate()); |
break; |
case DataViewTag: |
- *value = toV8(DOMDataView::create(arrayBuffer, byteOffset, byteLength), creationContext, isolate()); |
+ *value = toV8(DOMDataView::create(arrayBuffer.release(), byteOffset, byteLength), creationContext, isolate()); |
break; |
} |
return !value->IsEmpty(); |
@@ -2154,10 +2154,10 @@ |
return false; |
v8::Local<v8::Value> result = m_arrayBuffers.at(index); |
if (result.IsEmpty()) { |
- DOMArrayBuffer* buffer = DOMArrayBuffer::create(m_arrayBufferContents->at(index)); |
+ RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::create(m_arrayBufferContents->at(index)); |
v8::Isolate* isolate = m_reader.getScriptState()->isolate(); |
v8::Local<v8::Object> creationContext = m_reader.getScriptState()->context()->Global(); |
- result = toV8(buffer, creationContext, isolate); |
+ result = toV8(buffer.get(), creationContext, isolate); |
if (result.IsEmpty()) |
return false; |
m_arrayBuffers[index] = result; |
@@ -2195,10 +2195,10 @@ |
return false; |
v8::Local<v8::Value> result = m_arrayBuffers.at(index); |
if (result.IsEmpty()) { |
- DOMSharedArrayBuffer* buffer = DOMSharedArrayBuffer::create(m_arrayBufferContents->at(index)); |
+ RefPtr<DOMSharedArrayBuffer> buffer = DOMSharedArrayBuffer::create(m_arrayBufferContents->at(index)); |
v8::Isolate* isolate = m_reader.getScriptState()->isolate(); |
v8::Local<v8::Object> creationContext = m_reader.getScriptState()->context()->Global(); |
- result = toV8(buffer, creationContext, isolate); |
+ result = toV8(buffer.get(), creationContext, isolate); |
if (result.IsEmpty()) |
return false; |
m_arrayBuffers[index] = result; |