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

Unified Diff: Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp

Issue 606653006: bindings: Adds DOMArrayBuffer, etc. as thin wrappers for ArrayBuffer, etc. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced. Created 6 years, 2 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
« no previous file with comments | « Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | Source/bindings/core/v8/custom/custom.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp b/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp
index 415a88cce74c7adcb221a5abc59ef8915b87bc98..090eeae3c28c2d8d11e4eca0d3b5b5b2ed3912ac 100644
--- a/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8XMLHttpRequestCustom.cpp
@@ -33,6 +33,8 @@
#include "bindings/core/v8/ExceptionMessages.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "bindings/core/v8/V8ArrayBuffer.h"
+#include "bindings/core/v8/V8ArrayBufferView.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/V8Blob.h"
#include "bindings/core/v8/V8Document.h"
@@ -40,15 +42,12 @@
#include "bindings/core/v8/V8HTMLDocument.h"
#include "bindings/core/v8/V8ReadableStream.h"
#include "bindings/core/v8/V8Stream.h"
-#include "bindings/core/v8/custom/V8ArrayBufferCustom.h"
-#include "bindings/core/v8/custom/V8ArrayBufferViewCustom.h"
#include "core/dom/Document.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/streams/ReadableStream.h"
#include "core/streams/Stream.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/xml/XMLHttpRequest.h"
-#include "wtf/ArrayBuffer.h"
#include <v8.h>
namespace blink {
@@ -67,7 +66,7 @@ void V8XMLHttpRequest::constructorCustom(const v8::FunctionCallbackInfo<v8::Valu
RefPtrWillBeRawPtr<XMLHttpRequest> xmlHttpRequest = XMLHttpRequest::create(context, securityOrigin);
v8::Handle<v8::Object> wrapper = info.Holder();
- V8DOMWrapper::associateObjectWithWrapper<V8XMLHttpRequest>(xmlHttpRequest.release(), &wrapperTypeInfo, wrapper, info.GetIsolate());
+ xmlHttpRequest->associateWithWrapper(xmlHttpRequest->wrapperTypeInfo(), wrapper, info.GetIsolate());
info.GetReturnValue().Set(wrapper);
}
@@ -148,10 +147,7 @@ void V8XMLHttpRequest::responseAttributeGetterCustom(const v8::PropertyCallbackI
case XMLHttpRequest::ResponseTypeArrayBuffer:
{
- ArrayBuffer* arrayBuffer = xmlHttpRequest->responseArrayBuffer();
- if (arrayBuffer) {
- arrayBuffer->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instanceTemplate());
- }
+ DOMArrayBuffer* arrayBuffer = xmlHttpRequest->responseArrayBuffer();
v8SetReturnValueFast(info, arrayBuffer, xmlHttpRequest);
return;
}
@@ -240,14 +236,14 @@ void V8XMLHttpRequest::sendMethodCustom(const v8::FunctionCallbackInfo<v8::Value
xmlHttpRequest->send(domFormData, exceptionState);
} else if (V8ArrayBuffer::hasInstance(arg, info.GetIsolate())) {
v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
- ArrayBuffer* arrayBuffer = V8ArrayBuffer::toImpl(object);
+ DOMArrayBuffer* arrayBuffer = V8ArrayBuffer::toImpl(object);
ASSERT(arrayBuffer);
- xmlHttpRequest->send(arrayBuffer, exceptionState);
+ xmlHttpRequest->send(arrayBuffer->buffer(), exceptionState);
} else if (V8ArrayBufferView::hasInstance(arg, info.GetIsolate())) {
v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
- ArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(object);
+ DOMArrayBufferView* arrayBufferView = V8ArrayBufferView::toImpl(object);
ASSERT(arrayBufferView);
- xmlHttpRequest->send(arrayBufferView, exceptionState);
+ xmlHttpRequest->send(arrayBufferView->view(), exceptionState);
} else {
TOSTRING_VOID(V8StringResource<TreatNullAsNullString>, argString, arg);
xmlHttpRequest->send(argString, exceptionState);
« no previous file with comments | « Source/bindings/core/v8/custom/V8WindowCustom.cpp ('k') | Source/bindings/core/v8/custom/custom.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698