Changeset 158333 in webkit


Ignore:
Timestamp:
Oct 30, 2013 5:32:58 PM (10 years ago)
Author:
ap@apple.com
Message:

XHR.response is null when requesting empty file as arraybuffer
https://bugs.webkit.org/show_bug.cgi?id=123457

Source/WebCore:

Reviewed by Sam Weinig.

Test: http/tests/xmlhttprequest/response-empty-arraybuffer.html

  • xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseArrayBuffer): Don't do this.

LayoutTests:

Based on a Blink test by yusukesuzuki@chromium.org.

Reviewed by Sam Weinig.

Failures in expected results appear to mean that Blink caches XHR responses in more
cases. It's not directly related to the patch.

  • http/tests/xmlhttprequest/response-empty-arraybuffer-expected.txt: Added.
  • http/tests/xmlhttprequest/response-empty-arraybuffer.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r158332 r158333  
     12013-10-30  Alexey Proskuryakov  <ap@apple.com>
     2
     3        XHR.response is null when requesting empty file as arraybuffer
     4        https://bugs.webkit.org/show_bug.cgi?id=123457
     5
     6        Based on a Blink test by yusukesuzuki@chromium.org.
     7
     8        Reviewed by Sam Weinig.
     9
     10        Failures in expected results appear to mean that Blink caches XHR responses in more
     11        cases. It's not directly related to the patch.
     12
     13        * http/tests/xmlhttprequest/response-empty-arraybuffer-expected.txt: Added.
     14        * http/tests/xmlhttprequest/response-empty-arraybuffer.html: Added.
     15
    1162013-10-30  Samuel White  <samuel_white@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r158332 r158333  
     12013-10-30  Alexey Proskuryakov  <ap@apple.com>
     2
     3        XHR.response is null when requesting empty file as arraybuffer
     4        https://bugs.webkit.org/show_bug.cgi?id=123457
     5
     6        Reviewed by Sam Weinig.
     7
     8        Test: http/tests/xmlhttprequest/response-empty-arraybuffer.html
     9
     10        * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::responseArrayBuffer): Don't do this.
     11
    1122013-10-30  Samuel White  <samuel_white@apple.com>
    213
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r157342 r158333  
    326326        return 0;
    327327
    328     if (!m_responseArrayBuffer.get() && m_binaryResponseBuilder.get() && m_binaryResponseBuilder->size() > 0) {
    329         m_responseArrayBuffer = ArrayBuffer::create(const_cast<char*>(m_binaryResponseBuilder->data()), static_cast<unsigned>(m_binaryResponseBuilder->size()));
     328    if (!m_responseArrayBuffer) {
     329        if (m_binaryResponseBuilder)
     330            m_responseArrayBuffer = ArrayBuffer::create(const_cast<char*>(m_binaryResponseBuilder->data()), static_cast<unsigned>(m_binaryResponseBuilder->size()));
     331        else
     332            m_responseArrayBuffer = ArrayBuffer::create(nullptr, 0);
    330333        m_binaryResponseBuilder.clear();
    331334    }
Note: See TracChangeset for help on using the changeset viewer.