Skip to content
  • benjamin@webkit.org's avatar
    SharedBuffer::getSomeData() must support m_dataArray if NETWORK_CFDATA_ARRAY_CALLBACK is defined · 9b91c1a7
    benjamin@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=77718
    
    Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-02-13
    Reviewed by David Kilzer.
    
    Previously, the last part of SharedBuffer::getSomeData() was systematically accessing
    the data from the segments. When NETWORK_CFDATA_ARRAY_CALLBACK is defined, there can
    be data in m_dataArray past the segment.
    
    The previous code was making invalid memory access pass the segment vector. This patch
    adds support for getting the data out of m_dataArray to make SharedBuffer::getSomeData()
    works with NETWORK_CFDATA_ARRAY_CALLBACK.
    
    This is covered by existing tests when NETWORK_CFDATA_ARRAY_CALLBACK is defined.
    The test 'fast/events/constructors/track-event-constructor.html' is a reliable test
    for this.
    
    * platform/SharedBuffer.cpp:
    (WebCore::SharedBuffer::getSomeData):
    * platform/SharedBuffer.h:
    (SharedBuffer):
    * platform/cf/SharedBufferCF.cpp:
    (WebCore):
    (WebCore::SharedBuffer::copySomeDataFromDataArray):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107648 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    9b91c1a7