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

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

Issue 1964183004: Revert of Move DOMArrayBuffer, DOMArrayBufferViews and DataView to the heap. (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/SerializedScriptValue.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp
index df2907e44b0ccaa4c984120f191d15bb4c6b8b4f..912db456d7b6a161151cef12680409bf1a023e7a 100644
--- a/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/SerializedScriptValue.cpp
@@ -137,7 +137,7 @@
OwnPtr<ArrayBufferContentsArray> contents = adoptPtr(new ArrayBufferContentsArray(arrayBuffers.size()));
- HeapHashSet<Member<DOMArrayBufferBase>> visited;
+ HashSet<DOMArrayBufferBase*> visited;
for (size_t i = 0; i < arrayBuffers.size(); i++) {
if (visited.contains(arrayBuffers[i].get()))
continue;
@@ -152,12 +152,12 @@
} else {
Vector<v8::Local<v8::ArrayBuffer>, 4> bufferHandles;
v8::HandleScope handleScope(isolate);
- acculumateArrayBuffersForAllWorlds(isolate, static_cast<DOMArrayBuffer*>(arrayBuffers[i].get()), bufferHandles);
+ acculumateArrayBuffersForAllWorlds(isolate, static_pointer_cast<DOMArrayBuffer>(arrayBuffers[i]).get(), bufferHandles);
bool isNeuterable = true;
for (size_t j = 0; j < bufferHandles.size(); j++)
isNeuterable &= bufferHandles[j]->IsNeuterable();
- DOMArrayBufferBase* toTransfer = arrayBuffers[i];
+ RefPtr<DOMArrayBufferBase> toTransfer = arrayBuffers[i];
if (!isNeuterable)
toTransfer = DOMArrayBuffer::create(arrayBuffers[i]->buffer());
bool result = toTransfer->transfer(contents->at(i));
@@ -233,26 +233,26 @@
}
ports.append(port);
} else if (V8ArrayBuffer::hasInstance(transferrable, isolate)) {
- DOMArrayBuffer* arrayBuffer = V8ArrayBuffer::toImpl(v8::Local<v8::Object>::Cast(transferrable));
+ RefPtr<DOMArrayBuffer> arrayBuffer = V8ArrayBuffer::toImpl(v8::Local<v8::Object>::Cast(transferrable));
if (arrayBuffers.contains(arrayBuffer)) {
exceptionState.throwDOMException(DataCloneError, "ArrayBuffer at index " + String::number(i) + " is a duplicate of an earlier ArrayBuffer.");
return false;
}
- arrayBuffers.append(arrayBuffer);
+ arrayBuffers.append(arrayBuffer.release());
} else if (V8SharedArrayBuffer::hasInstance(transferrable, isolate)) {
- DOMSharedArrayBuffer* sharedArrayBuffer = V8SharedArrayBuffer::toImpl(v8::Local<v8::Object>::Cast(transferrable));
+ RefPtr<DOMSharedArrayBuffer> sharedArrayBuffer = V8SharedArrayBuffer::toImpl(v8::Local<v8::Object>::Cast(transferrable));
if (arrayBuffers.contains(sharedArrayBuffer)) {
exceptionState.throwDOMException(DataCloneError, "SharedArrayBuffer at index " + String::number(i) + " is a duplicate of an earlier SharedArrayBuffer.");
return false;
}
- arrayBuffers.append(sharedArrayBuffer);
+ arrayBuffers.append(sharedArrayBuffer.release());
} else if (V8ImageBitmap::hasInstance(transferrable, isolate)) {
- ImageBitmap* imageBitmap = V8ImageBitmap::toImpl(v8::Local<v8::Object>::Cast(transferrable));
+ RawPtr<ImageBitmap> imageBitmap = V8ImageBitmap::toImpl(v8::Local<v8::Object>::Cast(transferrable));
if (imageBitmaps.contains(imageBitmap)) {
exceptionState.throwDOMException(DataCloneError, "ImageBitmap at index " + String::number(i) + " is a duplicate of an earlier ImageBitmap.");
return false;
}
- imageBitmaps.append(imageBitmap);
+ imageBitmaps.append(imageBitmap.release());
} else {
exceptionState.throwTypeError("Value at index " + String::number(i) + " does not have a transferable type.");
return false;

Powered by Google App Engine
This is Rietveld 408576698