Skip to content
  • jianli@chromium.org's avatar
    .: Blob.slice support. · f48782fd
    jianli@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=32993
    
    Reviewed by Dmitry Titov.
    
    Add ENABLE_BLOB_SLICE feature define.
    
    * configure.ac:
    
    JavaScriptCore: Blob.slice support.
    https://bugs.webkit.org/show_bug.cgi?id=32993
    
    Reviewed by Dmitry Titov.
    
    Add ENABLE_BLOB_SLICE feature define.
    Also fix a problem that JSValue.toInteger is not exposed on Windows.
    
    * Configurations/FeatureDefines.xcconfig:
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
    
    WebCore: Blob.slice support.
    https://bugs.webkit.org/show_bug.cgi?id=32993
    
    Reviewed by Dmitry Titov.
    
    The following semantic is adopted per the discussions on public-webapps:
    1) File.slice() does a synchronous IO to capture the current size and
       modification time and cache them in the resulting Blob.
    2) Subsequent Blob operations, like Blob.slice and Blob.size simply
       use the cached values.
    3) When the underlying file data are accessed, like in XHR.send(), the
       UA will check the cached modification time against the current
       modification time to determine if the file has been changed or not.
       An error or exception will be thrown if needed.
    
    Also add ENABLE_BLOB_SLICE feature define.
    
    Test: http/tests/local/send-sliced-dragged-file.html
    
    * Configurations/FeatureDefines.xcconfig:
    * GNUmakefile.am:
    * WebCore.pri:
    * html/Blob.cpp:
    (WebCore::Blob::Blob):
    (WebCore::Blob::size):
    (WebCore::Blob::slice):
    * html/Blob.h:
    (WebCore::Blob::start):
    (WebCore::Blob::length):
    (WebCore::Blob::modificationTime):
    * html/Blob.idl:
    * platform/network/FormData.cpp:
    (WebCore::FormData::deepCopy):
    (WebCore::FormData::appendFile):
    (WebCore::FormData::appendFileRange):
    * platform/network/FormData.h:
    (WebCore::FormDataElement::FormDataElement):
    (WebCore::operator==):
    * platform/network/mac/FormDataStreamMac.mm:
    (WebCore::advanceCurrentStream):
    (WebCore::openNextStream):
    (WebCore::formCreate):
    (WebCore::formOpen):
    (WebCore::formRead):
    (WebCore::setHTTPBody):
    * xml/XMLHttpRequest.cpp:
    (WebCore::XMLHttpRequest::send):
    
    WebKit/chromium: Blob.slice support.
    https://bugs.webkit.org/show_bug.cgi?id=32993
    
    Reviewed by Dmitry Titov.
    
    Add ENABLE_BLOB_SLICE feature define.
    
    * features.gypi:
    
    WebKit/mac: Blob.slice support.
    https://bugs.webkit.org/show_bug.cgi?id=32993
    
    Reviewed by Dmitry Titov.
    
    Add ENABLE_BLOB_SLICE feature define.
    
    * Configurations/FeatureDefines.xcconfig:
    
    WebKitLibraries: Blob.slice support.
    https://bugs.webkit.org/show_bug.cgi?id=32993
    
    Reviewed by Dmitry Titov.
    
    Add ENABLE_BLOB_SLICE feature define.
    
    * win/tools/vsprops/FeatureDefines.vsprops:
    * win/tools/vsprops/FeatureDefinesCairo.vsprops:
    
    WebKitTools: Blob.slice support.
    https://bugs.webkit.org/show_bug.cgi?id=32993
    
    Reviewed by Dmitry Titov.
    
    Add ENABLE_BLOB_SLICE feature define and  flag for build-webkit. It is
    currently only turned on for Mac.
    
    * Scripts/build-webkit:
    
    LayoutTests: Blob.slice support.
    https://bugs.webkit.org/show_bug.cgi?id=32993
    
    Reviewed by Dmitry Titov.
    
    Add a new layout test to test slicing and sending a file. In addition,
    two new scripts are introduced to create and touch the temp file.
    
    Move some code from send-dragged-file.js to a new file
    setup-file-input-element-for-drag.js so that it can be used by both
    send-dragged-file.js and send-sliced-dragged-file.js to setup the input
    element for the file dragging.
    
    Since the Blob.slice is only enabled for Mac, we disable the new test
    for all other platforms.
    
    * fast/dom/Window/window-properties.html:
    * http/tests/local/resources/file-for-drag-to-send.txt:
    * http/tests/local/resources/send-dragged-file.js:
    * http/tests/local/resources/send-sliced-dragged-file.js: Added.
    * http/tests/local/resources/setup-file-input-element-for-drag.js: Added.
    * http/tests/local/send-dragged-file.html:
    * http/tests/local/send-sliced-dragged-file-expected.txt: Added.
    * http/tests/local/send-sliced-dragged-file.html: Added.
    * http/tests/resources/touch-temp-file.php: Added.
    * http/tests/resources/write-temp-file.php: Added.
    * platform/gtk/Skipped:
    * platform/qt/Skipped:
    * platform/win/Skipped:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    f48782fd