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

Unified Diff: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.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/core/xmlhttprequest/XMLHttpRequest.cpp
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
index fbc52502f6975d45a687607d728d440bdc28402c..ed385f434241bf5d07c73495fa1c4c8716af01c8 100644
--- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
+++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -361,14 +361,14 @@
if (!m_responseArrayBuffer) {
if (m_binaryResponseBuilder && m_binaryResponseBuilder->size()) {
- DOMArrayBuffer* buffer = DOMArrayBuffer::createUninitialized(m_binaryResponseBuilder->size(), 1);
+ RefPtr<DOMArrayBuffer> buffer = DOMArrayBuffer::createUninitialized(m_binaryResponseBuilder->size(), 1);
if (!m_binaryResponseBuilder->getAsBytes(buffer->data(), static_cast<size_t>(buffer->byteLength()))) {
// m_binaryResponseBuilder failed to allocate an ArrayBuffer.
// We need to crash the renderer since there's no way defined in
// the spec to tell this to the user.
CRASH();
}
- m_responseArrayBuffer = buffer;
+ m_responseArrayBuffer = buffer.release();
m_binaryResponseBuilder.clear();
} else {
m_responseArrayBuffer = DOMArrayBuffer::create(nullptr, 0);
@@ -652,12 +652,12 @@
}
if (body.isArrayBuffer()) {
- send(body.getAsArrayBuffer(), exceptionState);
+ send(body.getAsArrayBuffer().get(), exceptionState);
return;
}
if (body.isArrayBufferView()) {
- send(body.getAsArrayBufferView(), exceptionState);
+ send(body.getAsArrayBufferView().get(), exceptionState);
return;
}
@@ -1701,7 +1701,6 @@
visitor->trace(m_responseLegacyStream);
visitor->trace(m_responseDocument);
visitor->trace(m_responseDocumentParser);
- visitor->trace(m_responseArrayBuffer);
visitor->trace(m_progressEventThrottle);
visitor->trace(m_upload);
visitor->trace(m_blobLoader);

Powered by Google App Engine
This is Rietveld 408576698