Chromium Code Reviews| Index: Source/core/xmlhttprequest/XMLHttpRequest.cpp |
| diff --git a/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/Source/core/xmlhttprequest/XMLHttpRequest.cpp |
| index 89f15e26b28d8347651cb66ea65f47c826815e4b..156a6e21b7dd0da7bb0718ad8ea55b2e1cc42c2d 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,52 @@ bool XMLHttpRequest::initSend(ExceptionState& exceptionState) |
| return true; |
| } |
| +void XMLHttpRequest::send(const ArrayBufferOrArrayBufferViewOrBlobOrDocumentOrHTMLDocumentOrStringOrFormData& data, ExceptionState& exceptionState) |
| +{ |
| + InspectorInstrumentation::willSendXMLHttpRequest(executionContext(), url()); |
| + if (data.isNull()) { |
| + send(exceptionState); |
| + return; |
| + } |
| + |
| + 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() || data.isHTMLDocument()) { |
| + Document* document = data.isDocument() ? data.getAsDocument().get() : data.getAsHTMLDocument().get(); |
| + send(document, exceptionState); |
| + return; |
| + } |
| + |
| + if (data.isHTMLDocument()) { |
|
yhirano
2015/03/23 11:50:41
This branch will never be taken.
vivekg
2015/03/23 11:57:36
Right!
|
| + send(data.getAsHTMLDocument().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()); |
|
yhirano
2015/03/23 11:50:41
Is this change related to the issue?
vivekg
2015/03/23 11:57:36
Yes this is being handled in https://code.google.c
yhirano
2015/03/23 12:44:33
Thanks, I see.
|
| send(String(), exceptionState); |
| } |