Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp |
diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp |
index 89f15e26b28d8347651cb66ea65f47c826815e4b..f10abe0c2f6232c1fa2d7783f2980af4b9082cee 100644 |
--- a/Source/core/xmlhttprequest/XMLHttpRequest.cpp |
+++ b/Source/core/xmlhttprequest/XMLHttpRequest.cpp |
@@ -24,6 +24,7 @@ |
#include "core/xmlhttprequest/XMLHttpRequest.h" |
#include "bindings/core/v8/ExceptionState.h" |
+#include "bindings/core/v8/UnionTypesCore.h" |
#include "core/dom/ContextFeatures.h" |
#include "core/dom/DOMArrayBuffer.h" |
#include "core/dom/DOMArrayBufferView.h" |
@@ -793,8 +794,46 @@ bool XMLHttpRequest::initSend(ExceptionState& exceptionState) |
return true; |
} |
+void XMLHttpRequest::send(const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrStringOrFormData& data, ExceptionState& exceptionState) |
+{ |
+ if (data.isNull()) { |
+ send(exceptionState); |
+ return; |
+ } |
+ |
+ InspectorInstrumentation::willSendXMLHttpRequest(executionContext(), url()); |
+ if (data.isArrayBuffer()) { |
+ send(data.getAsArrayBuffer().get(), exceptionState); |
+ return; |
+ } |
+ |
+ if (data.isArrayBufferView()) { |
+ send(data.getAsArrayBufferView().get(), exceptionState); |
+ return; |
+ } |
+ |
+ if (data.isBlob()) { |
+ send(data.getAsBlob(), exceptionState); |
+ return; |
+ } |
+ |
+ if (data.isDocument()) { |
+ send(data.getAsDocument().get(), exceptionState); |
+ return; |
+ } |
+ |
+ if (data.isFormData()) { |
+ send(data.getAsFormData().get(), exceptionState); |
+ return; |
+ } |
+ |
+ ASSERT(data.isString()); |
+ send(data.getAsString(), exceptionState); |
+} |
+ |
void XMLHttpRequest::send(ExceptionState& exceptionState) |
{ |
+ InspectorInstrumentation::willSendXMLHttpRequest(executionContext(), url()); |
send(String(), exceptionState); |
} |