Changeset 119698 in webkit


Ignore:
Timestamp:
Jun 7, 2012 2:42:57 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[FileAPI] FileReader should throw an InvalidStateError exception when readyState is LOADING
https://bugs.webkit.org/show_bug.cgi?id=88212

Patch by Li Yin <li.yin@intel.com> on 2012-06-07
Reviewed by Jian Li.

Source/WebCore:

From Spec: http://www.w3.org/TR/FileAPI/#readAsBinaryString
FileReader should throw an InvalidStateError exception instead of NOT_ALLOWED_ERR
when the readyState is LOADING.
Also delete OperationNotAllowedException related code, because it is not longer needed.

Tests: fast/files/read-file-async.html

fast/files/workers/worker-read-file-async.html

  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • DerivedSources.pri:
  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • dom/DOMExceptions.in:
  • fileapi/FileReader.cpp:

(WebCore::FileReader::readInternal): Changed it to throw INVALID_STATE_ERR.

  • fileapi/FileReader.idl: Changed it to raise DOMException for all read methods.
  • fileapi/OperationNotAllowedException.cpp: Removed.
  • fileapi/OperationNotAllowedException.h: Removed.
  • fileapi/OperationNotAllowedException.idl: Removed.

LayoutTests:

From spec: http://www.w3.org/TR/FileAPI/#readAsBinaryString
FileReader should throw an InvalidStateError exception instead of NOT_ALLOWED_ERR.

  • fast/files/read-file-async-expected.txt:
  • fast/files/workers/worker-read-file-async-expected.txt:
Location:
trunk
Files:
3 deleted
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r119693 r119698  
     12012-06-07  Li Yin  <li.yin@intel.com>
     2
     3        [FileAPI] FileReader should throw an InvalidStateError exception when readyState is LOADING
     4        https://bugs.webkit.org/show_bug.cgi?id=88212
     5
     6        Reviewed by Jian Li.
     7
     8        From spec: http://www.w3.org/TR/FileAPI/#readAsBinaryString
     9        FileReader should throw an InvalidStateError exception instead of NOT_ALLOWED_ERR.
     10
     11        * fast/files/read-file-async-expected.txt:
     12        * fast/files/workers/worker-read-file-async-expected.txt:
     13
    1142012-06-07  Hironori Bono  <hbono@chromium.org>
    215
  • trunk/LayoutTests/fast/files/read-file-async-expected.txt

    r118897 r119698  
    174174Test calling multiple concurrent read methods
    175175readyState: 0
    176 Received exception 1: NOT_ALLOWED_ERR
    177 Received exception 1: NOT_ALLOWED_ERR
    178 Received exception 1: NOT_ALLOWED_ERR
    179 Received exception 1: NOT_ALLOWED_ERR
     176Received exception 11: INVALID_STATE_ERR
     177Received exception 11: INVALID_STATE_ERR
     178Received exception 11: INVALID_STATE_ERR
     179Received exception 11: INVALID_STATE_ERR
    180180Received loadstart event
    181181readyState: 1
  • trunk/LayoutTests/fast/files/workers/worker-read-file-async-expected.txt

    r118897 r119698  
    175175Test calling multiple concurrent read methods
    176176readyState: 0
    177 Received exception 1: NOT_ALLOWED_ERR
    178 Received exception 1: NOT_ALLOWED_ERR
    179 Received exception 1: NOT_ALLOWED_ERR
    180 Received exception 1: NOT_ALLOWED_ERR
     177Received exception 11: INVALID_STATE_ERR
     178Received exception 11: INVALID_STATE_ERR
     179Received exception 11: INVALID_STATE_ERR
     180Received exception 11: INVALID_STATE_ERR
    181181Received loadstart event
    182182readyState: 1
  • trunk/Source/WebCore/CMakeLists.txt

    r119572 r119698  
    735735    fileapi/FileException.cpp
    736736    fileapi/FileList.cpp
    737     fileapi/OperationNotAllowedException.cpp
    738737    fileapi/ThreadableBlobRegistry.cpp
    739738    fileapi/WebKitBlobBuilder.cpp
     
    15161515        fileapi/FileException.idl
    15171516        fileapi/FileReaderSync.idl
    1518         fileapi/OperationNotAllowedException.idl
    15191517    )
    15201518ENDIF ()
  • trunk/Source/WebCore/ChangeLog

    r119696 r119698  
     12012-06-07  Li Yin  <li.yin@intel.com>
     2
     3        [FileAPI] FileReader should throw an InvalidStateError exception when readyState is LOADING
     4        https://bugs.webkit.org/show_bug.cgi?id=88212
     5
     6        Reviewed by Jian Li.
     7
     8        From Spec: http://www.w3.org/TR/FileAPI/#readAsBinaryString
     9        FileReader should throw an InvalidStateError exception instead of NOT_ALLOWED_ERR
     10        when the readyState is LOADING.
     11        Also delete OperationNotAllowedException related code, because it is not longer needed.
     12
     13        Tests: fast/files/read-file-async.html
     14               fast/files/workers/worker-read-file-async.html
     15
     16        * CMakeLists.txt:
     17        * DerivedSources.cpp:
     18        * DerivedSources.make:
     19        * DerivedSources.pri:
     20        * GNUmakefile.list.am:
     21        * Target.pri:
     22        * WebCore.gypi:
     23        * WebCore.vcproj/WebCore.vcproj:
     24        * WebCore.xcodeproj/project.pbxproj:
     25        * dom/DOMExceptions.in:
     26        * fileapi/FileReader.cpp:
     27        (WebCore::FileReader::readInternal): Changed it to throw INVALID_STATE_ERR.
     28        * fileapi/FileReader.idl: Changed it to raise DOMException for all read methods.
     29        * fileapi/OperationNotAllowedException.cpp: Removed.
     30        * fileapi/OperationNotAllowedException.h: Removed.
     31        * fileapi/OperationNotAllowedException.idl: Removed.
     32
    1332012-06-07  Sheriff Bot  <webkit.review.bot@gmail.com>
    234
  • trunk/Source/WebCore/DerivedSources.cpp

    r119367 r119698  
    256256#include "JSNotificationCenter.cpp"
    257257#include "JSNotification.cpp"
    258 #include "JSOperationNotAllowedException.cpp"
    259258#include "JSOverflowEvent.cpp"
    260259#include "JSPageTransitionEvent.cpp"
  • trunk/Source/WebCore/DerivedSources.make

    r119572 r119698  
    254254    $(WebCore)/fileapi/FileReader.idl \
    255255    $(WebCore)/fileapi/FileReaderSync.idl \
    256     $(WebCore)/fileapi/OperationNotAllowedException.idl \
    257256    $(WebCore)/fileapi/WebKitBlobBuilder.idl \
    258257    $(WebCore)/html/DOMFormData.idl \
  • trunk/Source/WebCore/DerivedSources.pri

    r119572 r119698  
    268268    $$PWD/fileapi/FileReader.idl \
    269269    $$PWD/fileapi/FileReaderSync.idl \
    270     $$PWD/fileapi/OperationNotAllowedException.idl \
    271270    $$PWD/fileapi/WebKitBlobBuilder.idl \
    272271    $$PWD/html/canvas/ArrayBufferView.idl \
  • trunk/Source/WebCore/GNUmakefile.list.am

    r119572 r119698  
    440440        DerivedSources/WebCore/JSOESVertexArrayObject.cpp \
    441441        DerivedSources/WebCore/JSOESVertexArrayObject.h \
    442         DerivedSources/WebCore/JSOperationNotAllowedException.cpp \
    443         DerivedSources/WebCore/JSOperationNotAllowedException.h \
    444442        DerivedSources/WebCore/JSOscillator.cpp \
    445443        DerivedSources/WebCore/JSOscillator.h \
     
    805803        $(WebCore)/fileapi/FileReader.idl \
    806804        $(WebCore)/fileapi/FileReaderSync.idl \
    807         $(WebCore)/fileapi/OperationNotAllowedException.idl \
    808805        $(WebCore)/fileapi/WebKitBlobBuilder.idl \
    809806        $(WebCore)/html/DOMFormData.idl \
     
    21942191        Source/WebCore/fileapi/FileThread.h \
    21952192        Source/WebCore/fileapi/FileThreadTask.h \
    2196         Source/WebCore/fileapi/OperationNotAllowedException.cpp \
    2197         Source/WebCore/fileapi/OperationNotAllowedException.h \
    21982193        Source/WebCore/fileapi/ThreadableBlobRegistry.cpp \
    21992194        Source/WebCore/fileapi/ThreadableBlobRegistry.h \
  • trunk/Source/WebCore/Target.pri

    r119572 r119698  
    707707    fileapi/FileReaderSync.cpp \
    708708    fileapi/FileThread.cpp \
    709     fileapi/OperationNotAllowedException.cpp \
    710709    fileapi/ThreadableBlobRegistry.cpp \
    711710    fileapi/WebKitBlobBuilder.cpp \
     
    18721871    fileapi/FileThread.h \
    18731872    fileapi/FileThreadTask.h \
    1874     fileapi/OperationNotAllowedException.h \
    18751873    fileapi/WebKitBlobBuilder.h \
    18761874    history/BackForwardController.h \
  • trunk/Source/WebCore/WebCore.gypi

    r119651 r119698  
    994994            'fileapi/FileReader.idl',
    995995            'fileapi/FileReaderSync.idl',
    996             'fileapi/OperationNotAllowedException.idl',
    997996            'fileapi/WebKitBlobBuilder.idl',
    998997            'html/DOMFormData.idl',
     
    26962695            'fileapi/FileThread.h',
    26972696            'fileapi/FileThreadTask.h',
    2698             'fileapi/OperationNotAllowedException.cpp',
    2699             'fileapi/OperationNotAllowedException.h',
    27002697            'fileapi/ThreadableBlobRegistry.cpp',
    27012698            'fileapi/ThreadableBlobRegistry.h',
     
    77367733            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESVertexArrayObject.cpp',
    77377734            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOESVertexArrayObject.h',
    7738             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOperationNotAllowedException.cpp',
    7739             '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOperationNotAllowedException.h',
    77407735            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOverflowEvent.cpp',
    77417736            '<(PRODUCT_DIR)/DerivedSources/WebCore/JSOverflowEvent.h',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r119572 r119698  
    1220712207                        </File>
    1220812208                        <File
    12209                                 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSOperationNotAllowedException.cpp"
    12210                                 >
    12211                         </File>
    12212                         <File
    12213                                 RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSOperationNotAllowedException.h"
    12214                                 >
    12215                         </File>
    12216                         <File
    1221712209                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSOverflowEvent.cpp"
    1221812210                                >
     
    6259662588                        </File>
    6259762589                        <File
    62598                                 RelativePath="..\fileapi\OperationNotAllowedException.cpp"
    62599                                 >
    62600                         </File>
    62601                         <File
    62602                                 RelativePath="..\fileapi\OperationNotAllowedException.h"
    62603                                 >
    62604                         </File>
    62605                         <File
    62606                                 RelativePath="..\fileapi\OperationNotAllowedException.h"
    62607                                 >
    62608                         </File>
    62609                         <File
    6261062590                                RelativePath="..\html\PasswordInputType.cpp"
    6261162591                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r119572 r119698  
    773773                2E0888D51148848A00AF4265 /* JSDOMFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E0888D31148848A00AF4265 /* JSDOMFormData.h */; };
    774774                2E0888E6114884E200AF4265 /* JSDOMFormDataCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */; };
    775                 2E2445F71395893A004B6C19 /* OperationNotAllowedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2445F51395893A004B6C19 /* OperationNotAllowedException.h */; };
    776                 2E24476813959173004B6C19 /* JSOperationNotAllowedException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E24476613959173004B6C19 /* JSOperationNotAllowedException.cpp */; };
    777                 2E24476913959173004B6C19 /* JSOperationNotAllowedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E24476713959173004B6C19 /* JSOperationNotAllowedException.h */; };
    778775                2E2D99CD10E2BBDA00496337 /* JSBlob.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */; };
    779776                2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99CC10E2BBDA00496337 /* JSBlob.h */; };
     
    35113508                978AD67514130A8D00C7CAE3 /* HTMLSpanElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 978AD67214130A8D00C7CAE3 /* HTMLSpanElement.h */; };
    35123509                978D07B6145A0F030096908D /* FileException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978D07B5145A0F030096908D /* FileException.cpp */; };
    3513                 978D07B8145A0F1B0096908D /* OperationNotAllowedException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978D07B7145A0F1B0096908D /* OperationNotAllowedException.cpp */; };
    35143510                978D07BA145A0F3C0096908D /* RangeException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978D07B9145A0F3C0096908D /* RangeException.cpp */; };
    35153511                978D07BC145A0F560096908D /* EventException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978D07BB145A0F560096908D /* EventException.cpp */; };
     
    77387734                2E0888D31148848A00AF4265 /* JSDOMFormData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMFormData.h; sourceTree = "<group>"; };
    77397735                2E0888E5114884E200AF4265 /* JSDOMFormDataCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMFormDataCustom.cpp; sourceTree = "<group>"; };
    7740                 2E2445F51395893A004B6C19 /* OperationNotAllowedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OperationNotAllowedException.h; path = fileapi/OperationNotAllowedException.h; sourceTree = "<group>"; };
    7741                 2E2445F61395893A004B6C19 /* OperationNotAllowedException.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = OperationNotAllowedException.idl; path = fileapi/OperationNotAllowedException.idl; sourceTree = "<group>"; };
    7742                 2E24476613959173004B6C19 /* JSOperationNotAllowedException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSOperationNotAllowedException.cpp; sourceTree = "<group>"; };
    7743                 2E24476713959173004B6C19 /* JSOperationNotAllowedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSOperationNotAllowedException.h; sourceTree = "<group>"; };
    77447736                2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlob.cpp; sourceTree = "<group>"; };
    77457737                2E2D99CC10E2BBDA00496337 /* JSBlob.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlob.h; sourceTree = "<group>"; };
     
    1057810570                978AD67314130A8D00C7CAE3 /* HTMLSpanElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLSpanElement.idl; sourceTree = "<group>"; };
    1057910571                978D07B5145A0F030096908D /* FileException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileException.cpp; path = fileapi/FileException.cpp; sourceTree = "<group>"; };
    10580                 978D07B7145A0F1B0096908D /* OperationNotAllowedException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OperationNotAllowedException.cpp; path = fileapi/OperationNotAllowedException.cpp; sourceTree = "<group>"; };
    1058110572                978D07B9145A0F3C0096908D /* RangeException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RangeException.cpp; sourceTree = "<group>"; };
    1058210573                978D07BB145A0F560096908D /* EventException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventException.cpp; sourceTree = "<group>"; };
     
    1677216763                                898785A2122CA2A7003AABDA /* JSMetadataCallback.cpp */,
    1677316764                                898785A3122CA2A7003AABDA /* JSMetadataCallback.h */,
    16774                                 2E24476613959173004B6C19 /* JSOperationNotAllowedException.cpp */,
    16775                                 2E24476713959173004B6C19 /* JSOperationNotAllowedException.h */,
    1677616765                                89CD029111C85B870070B791 /* JSWebKitBlobBuilder.cpp */,
    1677716766                                89CD029211C85B870070B791 /* JSWebKitBlobBuilder.h */,
     
    1759917588                                89878551122CA064003AABDA /* MetadataCallback.h */,
    1760017589                                E1AB1EC214E9E3D500449E13 /* MetadataCallback.idl */,
    17601                                 978D07B7145A0F1B0096908D /* OperationNotAllowedException.cpp */,
    17602                                 2E2445F51395893A004B6C19 /* OperationNotAllowedException.h */,
    17603                                 2E2445F61395893A004B6C19 /* OperationNotAllowedException.idl */,
    1760417590                                976D6C75122B8A3D001FD1F7 /* ThreadableBlobRegistry.cpp */,
    1760517591                                976D6C76122B8A3D001FD1F7 /* ThreadableBlobRegistry.h */,
     
    2356923555                                77A17AA712F28B2A004E02F6 /* JSOESVertexArrayObject.h in Headers */,
    2357023556                                FDF6BAF9134A4C9800822920 /* JSOfflineAudioCompletionEvent.h in Headers */,
    23571                                 2E24476913959173004B6C19 /* JSOperationNotAllowedException.h in Headers */,
    2357223557                                FDEA6243152102E200479DF0 /* JSOscillator.h in Headers */,
    2357323558                                1A0D57410A5C7867007EDD4C /* JSOverflowEvent.h in Headers */,
     
    2399323978                                FDA3E95C134A49EF008D4B5A /* OfflineAudioDestinationNode.h in Headers */,
    2399423979                                F4EAF4AF10C742B1009100D3 /* OpenTypeSanitizer.h in Headers */,
    23995                                 2E2445F71395893A004B6C19 /* OperationNotAllowedException.h in Headers */,
    2399623980                                0014628B103CD1DE000B20DB /* OriginAccessEntry.h in Headers */,
    2399723981                                97BC6A381505F081001B74AC /* OriginQuotaManager.h in Headers */,
     
    2677926763                                77A17AA612F28B2A004E02F6 /* JSOESVertexArrayObject.cpp in Sources */,
    2678026764                                FDF6BAF8134A4C9800822920 /* JSOfflineAudioCompletionEvent.cpp in Sources */,
    26781                                 2E24476813959173004B6C19 /* JSOperationNotAllowedException.cpp in Sources */,
    2678226765                                FDEA6242152102E200479DF0 /* JSOscillator.cpp in Sources */,
    2678326766                                1A0D57400A5C7867007EDD4C /* JSOverflowEvent.cpp in Sources */,
     
    2722027203                                FDA3E95B134A49EF008D4B5A /* OfflineAudioDestinationNode.cpp in Sources */,
    2722127204                                F4EAF4AE10C742B1009100D3 /* OpenTypeSanitizer.cpp in Sources */,
    27222                                 978D07B8145A0F1B0096908D /* OperationNotAllowedException.cpp in Sources */,
    2722327205                                0014628A103CD1DE000B20DB /* OriginAccessEntry.cpp in Sources */,
    2722427206                                97BC6A371505F081001B74AC /* OriginQuotaManager.cpp in Sources */,
  • trunk/Source/WebCore/dom/DOMExceptions.in

    r98793 r119698  
    55FileException conditional=BLOB
    66IDBDatabaseException conditional=INDEXED_DATABASE
    7 OperationNotAllowedException conditional=BLOB
    87RangeException
    98SQLException conditional=SQL_DATABASE
  • trunk/Source/WebCore/fileapi/FileReader.cpp

    r118897 r119698  
    3636
    3737#include "CrossThreadTask.h"
     38#include "ExceptionCode.h"
    3839#include "File.h"
    3940#include "Logging.h"
    40 #include "OperationNotAllowedException.h"
    4141#include "ProgressEvent.h"
    4242#include "ScriptExecutionContext.h"
     
    134134void FileReader::readInternal(Blob* blob, FileReaderLoader::ReadType type, ExceptionCode& ec)
    135135{
    136     // If multiple concurrent read methods are called on the same FileReader, OperationNotAllowedException should be thrown when the state is LOADING.
     136    // If multiple concurrent read methods are called on the same FileReader, INVALID_STATE_ERR should be thrown when the state is LOADING.
    137137    if (m_state == LOADING) {
    138         ec = OperationNotAllowedException::NOT_ALLOWED_ERR;
     138        ec = INVALID_STATE_ERR;
    139139        return;
    140140    }
  • trunk/Source/WebCore/fileapi/FileReader.idl

    r106737 r119698  
    4747        // async read methods
    4848        void readAsArrayBuffer(in Blob blob)
    49             raises(OperationNotAllowedException);
     49            raises(DOMException);
    5050        void readAsBinaryString(in Blob blob)
    51             raises(OperationNotAllowedException);
     51            raises(DOMException);
    5252        void readAsText(in Blob blob, in [Optional] DOMString encoding)
    53             raises(OperationNotAllowedException);
     53            raises(DOMException);
    5454        void readAsDataURL(in Blob blob)
    55             raises(OperationNotAllowedException);
     55            raises(DOMException);
    5656
    5757        void abort();
Note: See TracChangeset for help on using the changeset viewer.