Skip to content
Permalink
Browse files
2011-04-11 Chris Marrin <cmarrin@apple.com>
        Rubberstamped by Dan Bernstein.

        xhr.responseType = 'arraybuffer' works on Mac but not on Windows
        https://bugs.webkit.org/show_bug.cgi?id=50334

        Got rid of guards around arraybuffer logic in XHR. ArrayBuffer and friends
        are always turned on now, so there's not need for the guard. I reenabled the
        test that was Skipped on Windows and it works now.

        * bindings/js/JSXMLHttpRequestCustom.cpp:
        (WebCore::JSXMLHttpRequest::markChildren):
        (WebCore::JSXMLHttpRequest::send):
        (WebCore::JSXMLHttpRequest::response):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::responseArrayBuffer):
        (WebCore::XMLHttpRequest::setResponseType):
        (WebCore::XMLHttpRequest::send):
        (WebCore::XMLHttpRequest::clearResponseBuffers):
        (WebCore::XMLHttpRequest::didReceiveData):
        * xml/XMLHttpRequest.h:
        (WebCore::XMLHttpRequest::optionalResponseArrayBuffer):



Canonical link: https://commits.webkit.org/73294@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Chris Marrin committed Apr 11, 2011
1 parent b293b4a commit 0136831144a335ecfdf5f716eab98701741ec583
Showing 8 changed files with 39 additions and 60 deletions.
@@ -1,3 +1,18 @@
2011-04-11 Chris Marrin <cmarrin@apple.com>

Rubberstamped by Dan Bernstein.

xhr.responseType = 'arraybuffer' works on Mac but not on Windows
https://bugs.webkit.org/show_bug.cgi?id=50334

Unskipped the XHR ArrayBuffer test for Windows. I also got rid of a couple of bogus expected
results. These had errors in them for what Windows used to be returning. Now the non-platform
specific results files are correct for Windows.

* platform/win/Skipped:
* platform/win/fast/xmlhttprequest/xmlhttprequest-responsetype-abort-expected.txt: Removed.
* platform/win/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer-expected.txt: Removed.

2011-02-03 Martin Robinson <mrobinson@igalia.com>

Reviewed by Eric Seidel.
@@ -1172,9 +1172,6 @@ fast/animation
# This port doesn't support v8 i18n extension.
fast/js/i18n-bindings-locale.html

# For https://bugs.webkit.org/show_bug.cgi?id=54519
fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html

# https://bugs.webkit.org/show_bug.cgi?id=55921
# Windows port doesn't support HTML in pastes.
editing/pasteboard/onpaste-text-html-types.html

This file was deleted.

This file was deleted.

@@ -1,3 +1,27 @@
2011-04-11 Chris Marrin <cmarrin@apple.com>

Rubberstamped by Dan Bernstein.

xhr.responseType = 'arraybuffer' works on Mac but not on Windows
https://bugs.webkit.org/show_bug.cgi?id=50334

Got rid of guards around arraybuffer logic in XHR. ArrayBuffer and friends
are always turned on now, so there's not need for the guard. I reenabled the
test that was Skipped on Windows and it works now.

* bindings/js/JSXMLHttpRequestCustom.cpp:
(WebCore::JSXMLHttpRequest::markChildren):
(WebCore::JSXMLHttpRequest::send):
(WebCore::JSXMLHttpRequest::response):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseArrayBuffer):
(WebCore::XMLHttpRequest::setResponseType):
(WebCore::XMLHttpRequest::send):
(WebCore::XMLHttpRequest::clearResponseBuffers):
(WebCore::XMLHttpRequest::didReceiveData):
* xml/XMLHttpRequest.h:
(WebCore::XMLHttpRequest::optionalResponseArrayBuffer):

2011-04-11 Anna Cavender <annacc@chromium.org>

Reviewed by Eric Carlson.
@@ -64,10 +64,8 @@ void JSXMLHttpRequest::markChildren(MarkStack& markStack)
if (Document* responseDocument = m_impl->optionalResponseXML())
markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), responseDocument);

#if ENABLE(WEBGL) || ENABLE(BLOB)
if (ArrayBuffer* responseArrayBuffer = m_impl->optionalResponseArrayBuffer())
markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), responseArrayBuffer);
#endif

#if ENABLE(XHR_RESPONSE_BLOB)
if (Blob* responseBlob = m_impl->optionalResponseBlob())
@@ -124,10 +122,8 @@ JSValue JSXMLHttpRequest::send(ExecState* exec)
impl()->send(toBlob(val), ec);
else if (val.inherits(&JSDOMFormData::s_info))
impl()->send(toDOMFormData(val), ec);
#if ENABLE(WEBGL) || ENABLE(BLOB)
else if (val.inherits(&JSArrayBuffer::s_info))
impl()->send(toArrayBuffer(val), ec);
#endif
else
impl()->send(ustringToString(val.toString(exec)), ec);
}
@@ -189,7 +185,6 @@ JSValue JSXMLHttpRequest::response(ExecState* exec) const
#endif

case XMLHttpRequest::ResponseTypeArrayBuffer:
#if ENABLE(WEBGL) || ENABLE(BLOB)
{
ExceptionCode ec = 0;
ArrayBuffer* arrayBuffer = impl()->responseArrayBuffer(ec);
@@ -199,9 +194,6 @@ JSValue JSXMLHttpRequest::response(ExecState* exec) const
}
return toJS(exec, globalObject(), arrayBuffer);
}
#else
return jsUndefined();
#endif
}

return jsUndefined();
@@ -271,7 +271,6 @@ Blob* XMLHttpRequest::responseBlob(ExceptionCode& ec) const
}
#endif

#if ENABLE(WEBGL) || ENABLE(BLOB)
ArrayBuffer* XMLHttpRequest::responseArrayBuffer(ExceptionCode& ec)
{
if (m_responseTypeCode != ResponseTypeArrayBuffer) {
@@ -292,7 +291,6 @@ ArrayBuffer* XMLHttpRequest::responseArrayBuffer(ExceptionCode& ec)

return 0;
}
#endif

void XMLHttpRequest::setResponseType(const String& responseType, ExceptionCode& ec)
{
@@ -312,9 +310,7 @@ void XMLHttpRequest::setResponseType(const String& responseType, ExceptionCode&
m_responseTypeCode = ResponseTypeBlob;
#endif
} else if (responseType == "arraybuffer") {
#if ENABLE(WEBGL) || ENABLE(BLOB)
m_responseTypeCode = ResponseTypeArrayBuffer;
#endif
} else
ec = SYNTAX_ERR;
}
@@ -586,7 +582,6 @@ void XMLHttpRequest::send(DOMFormData* body, ExceptionCode& ec)
createRequest(ec);
}

#if ENABLE(WEBGL) || ENABLE(BLOB)
void XMLHttpRequest::send(ArrayBuffer* body, ExceptionCode& ec)
{
if (!initSend(ec))
@@ -600,7 +595,6 @@ void XMLHttpRequest::send(ArrayBuffer* body, ExceptionCode& ec)

createRequest(ec);
}
#endif

void XMLHttpRequest::createRequest(ExceptionCode& ec)
{
@@ -739,10 +733,8 @@ void XMLHttpRequest::clearResponseBuffers()
#if ENABLE(XHR_RESPONSE_BLOB)
m_responseBlob = 0;
#endif
#if ENABLE(WEBGL) || ENABLE(BLOB)
m_binaryResponseBuilder.clear();
m_responseArrayBuffer.clear();
#endif
}

void XMLHttpRequest::clearRequest()
@@ -1076,14 +1068,12 @@ void XMLHttpRequest::didReceiveData(const char* data, int len)

if (useDecoder)
m_responseBuilder.append(m_decoder->decode(data, len));
#if ENABLE(WEBGL) || ENABLE(BLOB)
else if (responseTypeCode() == ResponseTypeArrayBuffer) {
// Buffer binary data.
if (!m_binaryResponseBuilder)
m_binaryResponseBuilder = SharedBuffer::create();
m_binaryResponseBuilder->append(data, len);
}
#endif

if (!m_error) {
long long expectedLength = m_response.expectedContentLength();
@@ -95,9 +95,7 @@ class XMLHttpRequest : public RefCounted<XMLHttpRequest>, public EventTarget, pr
void send(const String&, ExceptionCode&);
void send(Blob*, ExceptionCode&);
void send(DOMFormData*, ExceptionCode&);
#if ENABLE(WEBGL) || ENABLE(BLOB)
void send(ArrayBuffer*, ExceptionCode&);
#endif
void abort();
void setRequestHeader(const AtomicString& name, const String& value, ExceptionCode&);
void overrideMimeType(const String& override);
@@ -115,11 +113,9 @@ class XMLHttpRequest : public RefCounted<XMLHttpRequest>, public EventTarget, pr
String responseType();
ResponseTypeCode responseTypeCode() const { return m_responseTypeCode; }

#if ENABLE(WEBGL) || ENABLE(BLOB)
// response attribute has custom getter.
ArrayBuffer* responseArrayBuffer(ExceptionCode&);
ArrayBuffer* optionalResponseArrayBuffer() const { return m_responseArrayBuffer.get(); }
#endif

void setLastSendLineNumber(unsigned lineNumber) { m_lastSendLineNumber = lineNumber; }
void setLastSendURL(const String& url) { m_lastSendURL = url; }
@@ -207,10 +203,8 @@ class XMLHttpRequest : public RefCounted<XMLHttpRequest>, public EventTarget, pr
mutable bool m_createdDocument;
mutable RefPtr<Document> m_responseXML;

#if ENABLE(WEBGL) || ENABLE(BLOB)
RefPtr<SharedBuffer> m_binaryResponseBuilder;
mutable RefPtr<ArrayBuffer> m_responseArrayBuffer;
#endif

bool m_error;

0 comments on commit 0136831

Please sign in to comment.