Skip to content
  • ap@apple.com's avatar
    FileReader crashes when file is not readable · b2852ac0
    ap@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=79715
    
    Reviewed by Jian Li.
    
    Source/WebCore:
    
    Test: fast/files/file-reader-directory-crash.html
    
    * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::SharedBuffer): Crash early if a caller
    mixed up in-band error signal with length again.
    
    * platform/network/BlobResourceHandle.cpp:
    (WebCore): Changed errors into an enum. Added a proper domain for blob errors.
    (WebCore::BlobResourceHandle::didReceiveResponse): There is already a constant for INT_MAX
    in C/C++.
    (WebCore::BlobResourceHandle::didRead): Don't send "-1" for failure down the success path.
    (WebCore::BlobResourceHandle::notifyFail): Use a proper domain for blob errors, and a non-
    empty message.
    
    LayoutTests:
    
    * fast/files/file-reader-directory-crash-expected.txt: Added.
    * fast/files/file-reader-directory-crash.html: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@109132 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    b2852ac0