Title: [262953] trunk
Revision
262953
Author
commit-qu...@webkit.org
Date
2020-06-12 09:14:44 -0700 (Fri, 12 Jun 2020)

Log Message

LayoutTests/imported/w3c:
Change FileReader.error to DOMException from obsoleted FileError
https://bugs.webkit.org/show_bug.cgi?id=213117

Patch by Tetsuharu Ohzeki <tetsuharu.ohz...@gmail.com> on 2020-06-12
Reviewed by Chris Dumez.

* web-platform-tests/FileAPI/historical.https-expected.txt:
  FileError should not be exposed.

Source/WebCore:
FileReader.error should be DOMException now
https://bugs.webkit.org/show_bug.cgi?id=213117

Patch by Tetsuharu Ohzeki <tetsuharu.ohz...@gmail.com> on 2020-06-12
Reviewed by Chris Dumez.

By the [lastest spec](https://w3c.github.io/FileAPI/),
`FileReader.error` should return `DOMException`
and this remove obsoleted `FileError` from exposed interfaces.

Internally, our codebase still depends on `fileapi/FileError.h`
in everywhere. I'll plan to create a patch to refactor them.

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.order:
* WebCore.xcodeproj/project.pbxproj:
* fileapi/FileError.idl: Removed.
* fileapi/FileReader.cpp:
(WebCore::FileReader::abort):
(WebCore::FileReader::didFail):
* fileapi/FileReader.h:
* fileapi/FileReader.idl:
* fileapi/FileReaderSync.cpp:
(WebCore::FileReaderSync::errorCodeToException):
* fileapi/FileReaderSync.h:

LayoutTests:
Change FileReader.error to DOMException from obsoleted FileError
https://bugs.webkit.org/show_bug.cgi?id=213117

Patch by Tetsuharu Ohzeki <tetsuharu.ohz...@gmail.com> on 2020-06-12
Reviewed by Chris Dumez.

By the [lastest spec](https://w3c.github.io/FileAPI/),
`FileReader.error` should return `DOMException`
and this change remove `FileError` from exposed interfaces.

* fast/files/file-reader-abort-expected.txt:
* fast/files/file-reader-abort-using-open-panel-expected.txt:
* fast/files/read-blob-async-expected.txt:
* fast/files/read-file-async-expected.txt:
* fast/files/workers/worker-read-blob-async-expected.txt:
* fast/files/workers/worker-read-file-async-expected.txt:
  Update to `DOMException` error code from `FileError` error code.
* platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt:
  FileError should not be exposed.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (262952 => 262953)


--- trunk/LayoutTests/ChangeLog	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/ChangeLog	2020-06-12 16:14:44 UTC (rev 262953)
@@ -1,3 +1,24 @@
+2020-06-12  Tetsuharu Ohzeki  <tetsuharu.ohz...@gmail.com>
+
+        Change FileReader.error to DOMException from obsoleted FileError
+        https://bugs.webkit.org/show_bug.cgi?id=213117
+
+        Reviewed by Chris Dumez.
+
+        By the [lastest spec](https://w3c.github.io/FileAPI/),
+        `FileReader.error` should return `DOMException`
+        and this change remove `FileError` from exposed interfaces.
+
+        * fast/files/file-reader-abort-expected.txt:
+        * fast/files/file-reader-abort-using-open-panel-expected.txt:
+        * fast/files/read-blob-async-expected.txt:
+        * fast/files/read-file-async-expected.txt:
+        * fast/files/workers/worker-read-blob-async-expected.txt:
+        * fast/files/workers/worker-read-file-async-expected.txt:
+          Update to `DOMException` error code from `FileError` error code.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt:
+          FileError should not be exposed.
+
 2020-06-12  Zalan Bujtas  <za...@apple.com>
 
         [LFC][TFC] Add support for min/max-width

Modified: trunk/LayoutTests/fast/files/file-reader-abort-expected.txt (262952 => 262953)


--- trunk/LayoutTests/fast/files/file-reader-abort-expected.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/fast/files/file-reader-abort-expected.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -1,7 +1,7 @@
 
 Test that FileReader.abort works.
 Received loadstart event
-Received error event: 3
+Received error event: 20
 Received abort event
 Received loadend event
 DONE

Modified: trunk/LayoutTests/fast/files/file-reader-abort-using-open-panel-expected.txt (262952 => 262953)


--- trunk/LayoutTests/fast/files/file-reader-abort-using-open-panel-expected.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/fast/files/file-reader-abort-using-open-panel-expected.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -2,7 +2,7 @@
 
 Test that FileReader.abort works.
 Received loadstart event
-Received error event: 3
+Received error event: 20
 Received abort event
 Received loadend event
 DONE

Modified: trunk/LayoutTests/fast/files/read-blob-async-expected.txt (262952 => 262953)


--- trunk/LayoutTests/fast/files/read-blob-async-expected.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/fast/files/read-blob-async-expected.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -3,7 +3,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a blob containing existent and non-existent file
@@ -10,7 +10,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a blob containing empty file

Modified: trunk/LayoutTests/fast/files/read-file-async-expected.txt (262952 => 262953)


--- trunk/LayoutTests/fast/files/read-file-async-expected.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/fast/files/read-file-async-expected.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -3,7 +3,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a non-existent file as binary string
@@ -10,7 +10,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a non-existent file as text
@@ -17,7 +17,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a non-existent file as data URL
@@ -24,7 +24,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading an empty file as array buffer
@@ -207,7 +207,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 readyState after recalling read method: 1

Modified: trunk/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt (262952 => 262953)


--- trunk/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/fast/files/workers/worker-read-blob-async-expected.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -4,7 +4,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a blob containing existent and non-existent file
@@ -11,7 +11,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a blob containing empty file

Modified: trunk/LayoutTests/fast/files/workers/worker-read-file-async-expected.txt (262952 => 262953)


--- trunk/LayoutTests/fast/files/workers/worker-read-file-async-expected.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/fast/files/workers/worker-read-file-async-expected.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -4,7 +4,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a non-existent file as binary string
@@ -11,7 +11,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a non-existent file as text
@@ -18,7 +18,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading a non-existent file as data URL
@@ -25,7 +25,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 Test reading an empty file as array buffer
@@ -208,7 +208,7 @@
 readyState: 0
 Received error event
 readyState: 2
-error code: 1
+error code: 8
 result: null
 Received loadend event
 readyState after recalling read method: 1

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (262952 => 262953)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-06-12 16:14:44 UTC (rev 262953)
@@ -1,3 +1,13 @@
+2020-06-12  Tetsuharu Ohzeki  <tetsuharu.ohz...@gmail.com>
+
+        Change FileReader.error to DOMException from obsoleted FileError
+        https://bugs.webkit.org/show_bug.cgi?id=213117
+
+        Reviewed by Chris Dumez.
+
+        * web-platform-tests/FileAPI/historical.https-expected.txt:
+          FileError should not be exposed.
+
 2020-06-11  Sam Weinig  <wei...@apple.com>
 
         Document.currentScript does not work for SVGScriptElements

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt (262952 => 262953)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -1,6 +1,6 @@
 
 PASS "toNativeLineEndings" should not be supported 
-FAIL "FileError" should not be supported assert_false: expected false got true
+PASS "FileError" should not be supported 
 PASS "FileException" should not be supported 
 PASS "FileHandle" should not be supported 
 PASS "FileRequest" should not be supported 

Modified: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt (262952 => 262953)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -1,6 +1,6 @@
 
 PASS "toNativeLineEndings" should not be supported 
-FAIL "FileError" should not be supported assert_false: expected false got true
+PASS "FileError" should not be supported 
 PASS "FileException" should not be supported 
 PASS "FileHandle" should not be supported 
 PASS "FileRequest" should not be supported 

Modified: trunk/Source/WebCore/CMakeLists.txt (262952 => 262953)


--- trunk/Source/WebCore/CMakeLists.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/CMakeLists.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -768,7 +768,6 @@
     fileapi/BlobPropertyBag.idl
     fileapi/EndingType.idl
     fileapi/File.idl
-    fileapi/FileError.idl
     fileapi/FileList.idl
     fileapi/FileReader.idl
     fileapi/FileReaderSync.idl

Modified: trunk/Source/WebCore/ChangeLog (262952 => 262953)


--- trunk/Source/WebCore/ChangeLog	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/ChangeLog	2020-06-12 16:14:44 UTC (rev 262953)
@@ -1,3 +1,34 @@
+2020-06-12  Tetsuharu Ohzeki  <tetsuharu.ohz...@gmail.com>
+
+        FileReader.error should be DOMException now
+        https://bugs.webkit.org/show_bug.cgi?id=213117
+
+        Reviewed by Chris Dumez.
+
+        By the [lastest spec](https://w3c.github.io/FileAPI/),
+        `FileReader.error` should return `DOMException`
+        and this remove obsoleted `FileError` from exposed interfaces.
+
+        Internally, our codebase still depends on `fileapi/FileError.h`
+        in everywhere. I'll plan to create a patch to refactor them.
+
+        * CMakeLists.txt:
+        * DerivedSources-input.xcfilelist:
+        * DerivedSources-output.xcfilelist:
+        * DerivedSources.make:
+        * Sources.txt:
+        * WebCore.order:
+        * WebCore.xcodeproj/project.pbxproj:
+        * fileapi/FileError.idl: Removed.
+        * fileapi/FileReader.cpp:
+        (WebCore::FileReader::abort):
+        (WebCore::FileReader::didFail):
+        * fileapi/FileReader.h:
+        * fileapi/FileReader.idl:
+        * fileapi/FileReaderSync.cpp:
+        (WebCore::FileReaderSync::errorCodeToException):
+        * fileapi/FileReaderSync.h:
+
 2020-06-12  Zalan Bujtas  <za...@apple.com>
 
         [LFC][TFC] Add support for min/max-width

Modified: trunk/Source/WebCore/DerivedSources-input.xcfilelist (262952 => 262953)


--- trunk/Source/WebCore/DerivedSources-input.xcfilelist	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/DerivedSources-input.xcfilelist	2020-06-12 16:14:44 UTC (rev 262953)
@@ -704,7 +704,6 @@
 $(PROJECT_DIR)/fileapi/BlobPropertyBag.idl
 $(PROJECT_DIR)/fileapi/EndingType.idl
 $(PROJECT_DIR)/fileapi/File.idl
-$(PROJECT_DIR)/fileapi/FileError.idl
 $(PROJECT_DIR)/fileapi/FileList.idl
 $(PROJECT_DIR)/fileapi/FileReader.idl
 $(PROJECT_DIR)/fileapi/FileReaderSync.idl

Modified: trunk/Source/WebCore/DerivedSources-output.xcfilelist (262952 => 262953)


--- trunk/Source/WebCore/DerivedSources-output.xcfilelist	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/DerivedSources-output.xcfilelist	2020-06-12 16:14:44 UTC (rev 262953)
@@ -600,8 +600,6 @@
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSFile.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSFileCallback.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSFileCallback.h
-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSFileError.cpp
-$(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSFileError.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSFileList.cpp
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSFileList.h
 $(BUILT_PRODUCTS_DIR)/DerivedSources/WebCore/JSFileReader.cpp

Modified: trunk/Source/WebCore/DerivedSources.make (262952 => 262953)


--- trunk/Source/WebCore/DerivedSources.make	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/DerivedSources.make	2020-06-12 16:14:44 UTC (rev 262953)
@@ -733,7 +733,6 @@
     $(WebCore)/fileapi/BlobPropertyBag.idl \
     $(WebCore)/fileapi/EndingType.idl \
     $(WebCore)/fileapi/File.idl \
-    $(WebCore)/fileapi/FileError.idl \
     $(WebCore)/fileapi/FileList.idl \
     $(WebCore)/fileapi/FileReader.idl \
     $(WebCore)/fileapi/FileReaderSync.idl \

Modified: trunk/Source/WebCore/Sources.txt (262952 => 262953)


--- trunk/Source/WebCore/Sources.txt	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/Sources.txt	2020-06-12 16:14:44 UTC (rev 262953)
@@ -2952,7 +2952,6 @@
 JSFetchResponse.cpp
 JSFile.cpp
 JSFileCallback.cpp
-JSFileError.cpp
 JSFileList.cpp
 JSFileReader.cpp
 JSFileReaderSync.cpp

Modified: trunk/Source/WebCore/WebCore.order (262952 => 262953)


--- trunk/Source/WebCore/WebCore.order	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/WebCore.order	2020-06-12 16:14:44 UTC (rev 262953)
@@ -21402,13 +21402,6 @@
 __ZN7WebCore15JSFilePrototype6s_infoE
 __ZN7WebCore6JSFile6s_infoE
 __ZN7WebCoreL17JSFileTableValuesE
-__ZN7WebCore22JSFileErrorConstructor6s_infoE
-__ZN7WebCore20JSFileErrorPrototype6s_infoE
-__ZN7WebCore11JSFileError6s_infoE
-__ZTVN7WebCore16JSFileErrorOwnerE
-__ZN7WebCoreL22JSFileErrorTableValuesE
-__ZN7WebCoreL31JSFileErrorPrototypeTableValuesE
-__ZN7WebCoreL33JSFileErrorConstructorTableValuesE
 __ZN7WebCore26JSFileExceptionConstructor6s_infoE
 __ZN7WebCore24JSFileExceptionPrototype6s_infoE
 __ZN7WebCore15JSFileException6s_infoE
@@ -24710,9 +24703,6 @@
 __ZN7WebCoreL11JSFileTableE
 __ZN7WebCoreL20JSFilePrototypeTableE
 __ZN7WebCoreL22JSFileConstructorTableE
-__ZN7WebCoreL16JSFileErrorTableE
-__ZN7WebCoreL25JSFileErrorPrototypeTableE
-__ZN7WebCoreL27JSFileErrorConstructorTableE
 __ZZN7WebCore12wrapperOwnerEPNS_15DOMWrapperWorldEPNS_9FileErrorEE16jsFileErrorOwner
 __ZGVZN7WebCore12wrapperOwnerEPNS_15DOMWrapperWorldEPNS_9FileErrorEE16jsFileErrorOwner
 __ZN7WebCoreL20JSFileExceptionTableE

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (262952 => 262953)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2020-06-12 16:14:44 UTC (rev 262953)
@@ -832,7 +832,6 @@
 		2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E2D99CC10E2BBDA00496337 /* JSBlob.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		2E37DFDB12DBAFB800A6B233 /* DOMURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E37DFD812DBAFB800A6B233 /* DOMURL.h */; };
 		2E37E00612DBC5A400A6B233 /* JSDOMURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E37E00412DBC5A400A6B233 /* JSDOMURL.h */; };
-		2E3BC0CB117D3E0800B9409A /* JSFileError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E3BC0C9117D3E0800B9409A /* JSFileError.h */; };
 		2E4346460F546A8200B0F1BA /* Worker.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346340F546A8200B0F1BA /* Worker.h */; };
 		2E4346490F546A8200B0F1BA /* WorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346370F546A8200B0F1BA /* WorkerGlobalScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		2E43464B0F546A8200B0F1BA /* WorkerGlobalScopeProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 2E4346390F546A8200B0F1BA /* WorkerGlobalScopeProxy.h */; };
@@ -6943,8 +6942,6 @@
 		2E37DFD912DBAFB800A6B233 /* DOMURL.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMURL.idl; sourceTree = "<group>"; };
 		2E37E00312DBC5A400A6B233 /* JSDOMURL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMURL.cpp; sourceTree = "<group>"; };
 		2E37E00412DBC5A400A6B233 /* JSDOMURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMURL.h; sourceTree = "<group>"; };
-		2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileError.cpp; sourceTree = "<group>"; };
-		2E3BC0C9117D3E0800B9409A /* JSFileError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileError.h; sourceTree = "<group>"; };
 		2E4346330F546A8200B0F1BA /* Worker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Worker.cpp; sourceTree = "<group>"; };
 		2E4346340F546A8200B0F1BA /* Worker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Worker.h; sourceTree = "<group>"; };
 		2E4346350F546A8200B0F1BA /* Worker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Worker.idl; sourceTree = "<group>"; };
@@ -15282,7 +15279,6 @@
 		E1A643FC0EC097A000779668 /* WorkerScriptController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WorkerScriptController.cpp; sourceTree = "<group>"; };
 		E1AB1EA814E9E27D00449E13 /* FileList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FileList.idl; sourceTree = "<group>"; };
 		E1AB1EB714E9E35800449E13 /* File.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = File.idl; sourceTree = "<group>"; };
-		E1AB1EBB14E9E37A00449E13 /* FileError.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = FileError.idl; sourceTree = "<group>"; };
 		E1AB1EBD14E9E3A800449E13 /* FileReaderSync.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = FileReaderSync.idl; sourceTree = "<group>"; };
 		E1ADECBD0E76ACF1004A1A5E /* MessagePort.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = MessagePort.h; sourceTree = "<group>"; };
 		E1ADECBE0E76ACF1004A1A5E /* MessagePort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MessagePort.cpp; sourceTree = "<group>"; };
@@ -21938,8 +21934,6 @@
 				7C77C3DA1DEF86D700A50BFA /* JSEndingType.h */,
 				BC00F0100E0A189500FD04E3 /* JSFile.cpp */,
 				BC00F0110E0A189500FD04E3 /* JSFile.h */,
-				2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */,
-				2E3BC0C9117D3E0800B9409A /* JSFileError.h */,
 				BC00F0120E0A189500FD04E3 /* JSFileList.cpp */,
 				BC00F0130E0A189500FD04E3 /* JSFileList.h */,
 				2E94F439119207DA00B7F75D /* JSFileReader.cpp */,
@@ -22927,7 +22921,6 @@
 				E1AB1EB714E9E35800449E13 /* File.idl */,
 				E164A2E7191AC5BB0010737D /* FileCocoa.mm */,
 				976D6C64122B8A3D001FD1F7 /* FileError.h */,
-				E1AB1EBB14E9E37A00449E13 /* FileError.idl */,
 				976D6C66122B8A3D001FD1F7 /* FileList.cpp */,
 				976D6C67122B8A3D001FD1F7 /* FileList.h */,
 				E1AB1EA814E9E27D00449E13 /* FileList.idl */,
@@ -31394,7 +31387,6 @@
 				8E4C96DD1AD4483500365A50 /* JSFetchResponse.h in Headers */,
 				BC00F0150E0A189500FD04E3 /* JSFile.h in Headers */,
 				8370568E1F50915700D93425 /* JSFileCallback.h in Headers */,
-				2E3BC0CB117D3E0800B9409A /* JSFileError.h in Headers */,
 				BC00F0170E0A189500FD04E3 /* JSFileList.h in Headers */,
 				2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */,
 				898785F5122E1EAC003AABDA /* JSFileReaderSync.h in Headers */,

Deleted: trunk/Source/WebCore/fileapi/FileError.idl (262952 => 262953)


--- trunk/Source/WebCore/fileapi/FileError.idl	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/fileapi/FileError.idl	2020-06-12 16:14:44 UTC (rev 262953)
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-[
-    ImplementationLacksVTable
-] interface FileError {
-    const unsigned short NOT_FOUND_ERR = 1;
-    const unsigned short SECURITY_ERR = 2;
-    const unsigned short ABORT_ERR = 3;
-    const unsigned short NOT_READABLE_ERR = 4;
-    const unsigned short ENCODING_ERR = 5;
-    const unsigned short NO_MODIFICATION_ALLOWED_ERR = 6;
-    const unsigned short INVALID_STATE_ERR = 7;
-    const unsigned short SYNTAX_ERR = 8;
-    const unsigned short INVALID_MODIFICATION_ERR = 9;
-    const unsigned short QUOTA_EXCEEDED_ERR = 10;
-    const unsigned short TYPE_MISMATCH_ERR = 11;
-    const unsigned short PATH_EXISTS_ERR = 12;
-
-    readonly attribute unsigned short code;
-};

Modified: trunk/Source/WebCore/fileapi/FileReader.cpp (262952 => 262953)


--- trunk/Source/WebCore/fileapi/FileReader.cpp	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/fileapi/FileReader.cpp	2020-06-12 16:14:44 UTC (rev 262953)
@@ -31,9 +31,13 @@
 #include "config.h"
 #include "FileReader.h"
 
+#include "DOMException.h"
 #include "EventLoop.h"
 #include "EventNames.h"
+#include "Exception.h"
+#include "ExceptionCode.h"
 #include "File.h"
+#include "FileError.h"
 #include "Logging.h"
 #include "ProgressEvent.h"
 #include "ScriptExecutionContext.h"
@@ -162,7 +166,7 @@
         stop();
         m_aborting = false;
 
-        m_error = FileError::create(FileError::ABORT_ERR);
+        m_error = DOMException::create(Exception { AbortError });
 
         fireEvent(eventNames().errorEvent);
         fireEvent(eventNames().abortEvent);
@@ -217,7 +221,10 @@
         ASSERT(m_state != DONE);
         m_state = DONE;
 
-        m_error = FileError::create(static_cast<FileError::ErrorCode>(errorCode));
+        auto e = FileReaderSync::errorCodeToException(static_cast<FileError::ErrorCode>(errorCode));
+        ASSERT(e.hasException());
+        m_error = DOMException::create(e.exception());
+
         fireEvent(eventNames().errorEvent);
         fireEvent(eventNames().loadendEvent);
     });

Modified: trunk/Source/WebCore/fileapi/FileReader.h (262952 => 262953)


--- trunk/Source/WebCore/fileapi/FileReader.h	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/fileapi/FileReader.h	2020-06-12 16:14:44 UTC (rev 262953)
@@ -31,11 +31,12 @@
 #pragma once
 
 #include "ActiveDOMObject.h"
+#include "DOMException.h"
 #include "EventTarget.h"
 #include "ExceptionOr.h"
-#include "FileError.h"
 #include "FileReaderLoader.h"
 #include "FileReaderLoaderClient.h"
+#include "FileReaderSync.h"
 #include <wtf/HashMap.h>
 #include <wtf/UniqueRef.h>
 
@@ -69,7 +70,7 @@
     void doAbort();
 
     ReadyState readyState() const { return m_state; }
-    RefPtr<FileError> error() { return m_error; }
+    DOMException* error() { return m_error.get(); }
     FileReaderLoader::ReadType readType() const { return m_readType; }
     Optional<Variant<String, RefPtr<JSC::ArrayBuffer>>> result() const;
 
@@ -106,7 +107,7 @@
     FileReaderLoader::ReadType m_readType { FileReaderLoader::ReadAsBinaryString };
     String m_encoding;
     std::unique_ptr<FileReaderLoader> m_loader;
-    RefPtr<FileError> m_error;
+    RefPtr<DOMException> m_error;
     MonotonicTime m_lastProgressNotificationTime { MonotonicTime::nan() };
     HashMap<uint64_t, Function<void()>> m_pendingTasks;
 };

Modified: trunk/Source/WebCore/fileapi/FileReader.idl (262952 => 262953)


--- trunk/Source/WebCore/fileapi/FileReader.idl	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/fileapi/FileReader.idl	2020-06-12 16:14:44 UTC (rev 262953)
@@ -52,7 +52,7 @@
 
     readonly attribute (DOMString or ArrayBuffer)? result;
 
-    readonly attribute FileError error;
+    readonly attribute DOMException? error;
 
     attribute EventHandler onloadstart;
     attribute EventHandler onprogress;

Modified: trunk/Source/WebCore/fileapi/FileReaderSync.cpp (262952 => 262953)


--- trunk/Source/WebCore/fileapi/FileReaderSync.cpp	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/fileapi/FileReaderSync.cpp	2020-06-12 16:14:44 UTC (rev 262953)
@@ -34,6 +34,7 @@
 
 #include "Blob.h"
 #include "BlobURL.h"
+#include "FileError.h"
 #include "FileReaderLoader.h"
 #include <_javascript_Core/ArrayBuffer.h>
 
@@ -72,7 +73,7 @@
     return startLoadingString(scriptExecutionContext, loader, blob);
 }
 
-static ExceptionOr<void> errorCodeToException(FileError::ErrorCode errorCode)
+ExceptionOr<void> FileReaderSync::errorCodeToException(FileError::ErrorCode errorCode)
 {
     switch (errorCode) {
     case FileError::OK:

Modified: trunk/Source/WebCore/fileapi/FileReaderSync.h (262952 => 262953)


--- trunk/Source/WebCore/fileapi/FileReaderSync.h	2020-06-12 16:09:05 UTC (rev 262952)
+++ trunk/Source/WebCore/fileapi/FileReaderSync.h	2020-06-12 16:14:44 UTC (rev 262953)
@@ -31,6 +31,7 @@
 #pragma once
 
 #include "ExceptionOr.h"
+#include "FileError.h"
 
 namespace JSC {
 class ArrayBuffer;
@@ -54,6 +55,8 @@
     ExceptionOr<String> readAsText(ScriptExecutionContext&, Blob&, const String& encoding);
     ExceptionOr<String> readAsDataURL(ScriptExecutionContext&, Blob&);
 
+    static ExceptionOr<void> errorCodeToException(FileError::ErrorCode);
+
 private:
     FileReaderSync();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to