Title: [219699] trunk
Revision
219699
Author
[email protected]
Date
2017-07-20 13:35:12 -0700 (Thu, 20 Jul 2017)

Log Message

Drop legacy FileException type
https://bugs.webkit.org/show_bug.cgi?id=174676

Reviewed by Alex Christensen.

Drop legacy FileException type and use DOMException instead, as per the latest
File API specification:
- https://w3c.github.io/FileAPI/#ErrorAndException

Both Firefox and Chrome no longer expose FileException.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::createDOMException):
* dom/DOMExceptions.in:
* fileapi/FileException.cpp: Removed.
* fileapi/FileException.h: Removed.
* fileapi/FileException.idl: Removed.
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::FileReaderLoader):
(WebCore::FileReaderLoader::failed):
* fileapi/FileReaderLoader.h:
(WebCore::FileReaderLoader::errorCode):
* fileapi/FileReaderSync.cpp:
(WebCore::errorCodeToExceptionCode):
(WebCore::FileReaderSync::startLoading):

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt (219698 => 219699)


--- trunk/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/LayoutTests/fast/files/workers/worker-read-blob-sync-expected.txt	2017-07-20 20:35:12 UTC (rev 219699)
@@ -1,10 +1,10 @@
 
 Received files in worker
 Test reading a blob containing non-existent file
-Received exception 1: NOT_FOUND_ERR
+Received exception 8: NotFoundError
 Received exception undefined: TypeError
 Test reading a blob containing existent and non-existent file
-Received exception 1: NOT_FOUND_ERR
+Received exception 8: NotFoundError
 Received exception undefined: TypeError
 Test reading a blob containing empty file
 result size: 0

Modified: trunk/LayoutTests/fast/files/workers/worker-read-file-sync-expected.txt (219698 => 219699)


--- trunk/LayoutTests/fast/files/workers/worker-read-file-sync-expected.txt	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/LayoutTests/fast/files/workers/worker-read-file-sync-expected.txt	2017-07-20 20:35:12 UTC (rev 219699)
@@ -1,16 +1,16 @@
 
 Received files in worker
 Test reading a non-existent file as array buffer
-Received exception 1: NOT_FOUND_ERR
+Received exception 8: NotFoundError
 Received exception undefined: TypeError
 Test reading a non-existent file as binary string
-Received exception 1: NOT_FOUND_ERR
+Received exception 8: NotFoundError
 Received exception undefined: TypeError
 Test reading a non-existent file as text
-Received exception 1: NOT_FOUND_ERR
+Received exception 8: NotFoundError
 Received exception undefined: TypeError
 Test reading a non-existent file as data URL
-Received exception 1: NOT_FOUND_ERR
+Received exception 8: NotFoundError
 Received exception undefined: TypeError
 Test reading an empty file as array buffer
 result size: 0

Modified: trunk/Source/WebCore/CMakeLists.txt (219698 => 219699)


--- trunk/Source/WebCore/CMakeLists.txt	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/CMakeLists.txt	2017-07-20 20:35:12 UTC (rev 219699)
@@ -516,7 +516,6 @@
     fileapi/BlobPropertyBag.idl
     fileapi/File.idl
     fileapi/FileError.idl
-    fileapi/FileException.idl
     fileapi/FileList.idl
     fileapi/FileReader.idl
     fileapi/FileReaderSync.idl
@@ -1695,7 +1694,6 @@
     fileapi/BlobCallback.cpp
     fileapi/BlobURL.cpp
     fileapi/File.cpp
-    fileapi/FileException.cpp
     fileapi/FileList.cpp
     fileapi/FileReader.cpp
     fileapi/FileReaderLoader.cpp

Modified: trunk/Source/WebCore/ChangeLog (219698 => 219699)


--- trunk/Source/WebCore/ChangeLog	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/ChangeLog	2017-07-20 20:35:12 UTC (rev 219699)
@@ -1,3 +1,35 @@
+2017-07-20  Chris Dumez  <[email protected]>
+
+        Drop legacy FileException type
+        https://bugs.webkit.org/show_bug.cgi?id=174676
+
+        Reviewed by Alex Christensen.
+
+        Drop legacy FileException type and use DOMException instead, as per the latest
+        File API specification:
+        - https://w3c.github.io/FileAPI/#ErrorAndException
+
+        Both Firefox and Chrome no longer expose FileException.
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSDOMExceptionHandling.cpp:
+        (WebCore::createDOMException):
+        * dom/DOMExceptions.in:
+        * fileapi/FileException.cpp: Removed.
+        * fileapi/FileException.h: Removed.
+        * fileapi/FileException.idl: Removed.
+        * fileapi/FileReaderLoader.cpp:
+        (WebCore::FileReaderLoader::FileReaderLoader):
+        (WebCore::FileReaderLoader::failed):
+        * fileapi/FileReaderLoader.h:
+        (WebCore::FileReaderLoader::errorCode):
+        * fileapi/FileReaderSync.cpp:
+        (WebCore::errorCodeToExceptionCode):
+        (WebCore::FileReaderSync::startLoading):
+
 2017-07-20  Sam Weinig  <[email protected]>
 
         [WebIDL] Remove custom bindings for InspectorFrontendHost

Modified: trunk/Source/WebCore/DerivedSources.cpp (219698 => 219699)


--- trunk/Source/WebCore/DerivedSources.cpp	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/DerivedSources.cpp	2017-07-20 20:35:12 UTC (rev 219699)
@@ -191,7 +191,6 @@
 #include "JSFetchResponse.cpp"
 #include "JSFile.cpp"
 #include "JSFileError.cpp"
-#include "JSFileException.cpp"
 #include "JSFileList.cpp"
 #include "JSFileReader.cpp"
 #include "JSFileReaderSync.cpp"

Modified: trunk/Source/WebCore/DerivedSources.make (219698 => 219699)


--- trunk/Source/WebCore/DerivedSources.make	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/DerivedSources.make	2017-07-20 20:35:12 UTC (rev 219699)
@@ -442,7 +442,6 @@
     $(WebCore)/fileapi/BlobPropertyBag.idl \
     $(WebCore)/fileapi/File.idl \
     $(WebCore)/fileapi/FileError.idl \
-    $(WebCore)/fileapi/FileException.idl \
     $(WebCore)/fileapi/FileList.idl \
     $(WebCore)/fileapi/FileReader.idl \
     $(WebCore)/fileapi/FileReaderSync.idl \

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (219698 => 219699)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2017-07-20 20:35:12 UTC (rev 219699)
@@ -1333,7 +1333,6 @@
 		2EDEF1F7121B0EFC00726DB2 /* BlobRegistryImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		2EDF369C122C94B4002F7D4E /* FileReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */; };
 		2EDF369D122C94B4002F7D4E /* FileReaderSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF369B122C94B4002F7D4E /* FileReaderSync.h */; };
-		2EDF369F122C94C8002F7D4E /* FileException.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EDF369E122C94C8002F7D4E /* FileException.h */; };
 		2EEEE55C1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2EEEE55B1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm */; };
 		2EF1BFEA121C9F4200C27627 /* FileStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2EF1BFE8121C9F4200C27627 /* FileStream.cpp */; };
 		2EF1BFEB121C9F4200C27627 /* FileStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 2EF1BFE9121C9F4200C27627 /* FileStream.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3593,8 +3592,6 @@
 		86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */; };
 		86D982F7125C154000AD9E3D /* DocumentTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86D982F6125C154000AD9E3D /* DocumentTiming.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		8931DE5B14C44C44000DC9D2 /* JSBlobCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */; };
-		898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785EE122E1E87003AABDA /* JSFileException.cpp */; };
-		898785F1122E1E87003AABDA /* JSFileException.h in Headers */ = {isa = PBXBuildFile; fileRef = 898785EF122E1E87003AABDA /* JSFileException.h */; };
 		898785F4122E1EAC003AABDA /* JSFileReaderSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 898785F2122E1EAC003AABDA /* JSFileReaderSync.cpp */; };
 		898785F5122E1EAC003AABDA /* JSFileReaderSync.h in Headers */ = {isa = PBXBuildFile; fileRef = 898785F3122E1EAC003AABDA /* JSFileReaderSync.h */; };
 		89B5EAA111E8003D00F2367E /* LineEnding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89B5EA9F11E8003D00F2367E /* LineEnding.cpp */; };
@@ -4089,7 +4086,6 @@
 		977E2E0F12F0FC9C00C13380 /* XSSAuditorDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 977E2E0C12F0FC9C00C13380 /* XSSAuditorDelegate.h */; };
 		978AD67414130A8D00C7CAE3 /* HTMLSpanElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978AD67114130A8D00C7CAE3 /* HTMLSpanElement.cpp */; };
 		978AD67514130A8D00C7CAE3 /* HTMLSpanElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 978AD67214130A8D00C7CAE3 /* HTMLSpanElement.h */; };
-		978D07B6145A0F030096908D /* FileException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978D07B5145A0F030096908D /* FileException.cpp */; };
 		978D07BE145A0F6C0096908D /* DOMCoreException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978D07BD145A0F6C0096908D /* DOMCoreException.cpp */; };
 		978D07CA145A10160096908D /* SVGException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978D07C9145A10160096908D /* SVGException.cpp */; };
 		978D07CC145A102E0096908D /* XPathException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 978D07CB145A102E0096908D /* XPathException.cpp */; };
@@ -8915,7 +8911,6 @@
 		2EDEF1F1121B0EFC00726DB2 /* BlobRegistryImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobRegistryImpl.h; sourceTree = "<group>"; };
 		2EDF369A122C94B4002F7D4E /* FileReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileReaderSync.cpp; sourceTree = "<group>"; };
 		2EDF369B122C94B4002F7D4E /* FileReaderSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileReaderSync.h; sourceTree = "<group>"; };
-		2EDF369E122C94C8002F7D4E /* FileException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileException.h; sourceTree = "<group>"; };
 		2EEEE55B1B66A047008E2CBC /* WheelEventDeltaFilterMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WheelEventDeltaFilterMac.mm; sourceTree = "<group>"; };
 		2EF1BFE8121C9F4200C27627 /* FileStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileStream.cpp; sourceTree = "<group>"; };
 		2EF1BFE9121C9F4200C27627 /* FileStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileStream.h; sourceTree = "<group>"; };
@@ -11743,8 +11738,6 @@
 		892ABE6616EEE2E5009F3587 /* JSStorageUsageCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStorageUsageCallback.cpp; sourceTree = "<group>"; };
 		892ABE6716EEE2E5009F3587 /* JSStorageUsageCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStorageUsageCallback.h; sourceTree = "<group>"; };
 		8931DE5A14C44C44000DC9D2 /* JSBlobCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobCustom.cpp; sourceTree = "<group>"; };
-		898785EE122E1E87003AABDA /* JSFileException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileException.cpp; sourceTree = "<group>"; };
-		898785EF122E1E87003AABDA /* JSFileException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileException.h; sourceTree = "<group>"; };
 		898785F2122E1EAC003AABDA /* JSFileReaderSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFileReaderSync.cpp; sourceTree = "<group>"; };
 		898785F3122E1EAC003AABDA /* JSFileReaderSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFileReaderSync.h; sourceTree = "<group>"; };
 		89B5EA9F11E8003D00F2367E /* LineEnding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LineEnding.cpp; sourceTree = "<group>"; };
@@ -12267,7 +12260,6 @@
 		978AD67114130A8D00C7CAE3 /* HTMLSpanElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLSpanElement.cpp; sourceTree = "<group>"; };
 		978AD67214130A8D00C7CAE3 /* HTMLSpanElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLSpanElement.h; sourceTree = "<group>"; };
 		978AD67314130A8D00C7CAE3 /* HTMLSpanElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLSpanElement.idl; sourceTree = "<group>"; };
-		978D07B5145A0F030096908D /* FileException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileException.cpp; sourceTree = "<group>"; };
 		978D07BD145A0F6C0096908D /* DOMCoreException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMCoreException.cpp; sourceTree = "<group>"; };
 		978D07C9145A10160096908D /* SVGException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGException.cpp; sourceTree = "<group>"; };
 		978D07CB145A102E0096908D /* XPathException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPathException.cpp; sourceTree = "<group>"; };
@@ -15180,7 +15172,6 @@
 		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>"; };
-		E1AB1EBC14E9E39700449E13 /* FileException.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = FileException.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>"; };
@@ -19861,8 +19852,6 @@
 				BC00F0110E0A189500FD04E3 /* JSFile.h */,
 				2E3BC0C8117D3E0800B9409A /* JSFileError.cpp */,
 				2E3BC0C9117D3E0800B9409A /* JSFileError.h */,
-				898785EE122E1E87003AABDA /* JSFileException.cpp */,
-				898785EF122E1E87003AABDA /* JSFileException.h */,
 				BC00F0120E0A189500FD04E3 /* JSFileList.cpp */,
 				BC00F0130E0A189500FD04E3 /* JSFileList.h */,
 				2E94F439119207DA00B7F75D /* JSFileReader.cpp */,
@@ -20801,9 +20790,6 @@
 				E164A2E7191AC5BB0010737D /* FileCocoa.mm */,
 				976D6C64122B8A3D001FD1F7 /* FileError.h */,
 				E1AB1EBB14E9E37A00449E13 /* FileError.idl */,
-				978D07B5145A0F030096908D /* FileException.cpp */,
-				2EDF369E122C94C8002F7D4E /* FileException.h */,
-				E1AB1EBC14E9E39700449E13 /* FileException.idl */,
 				976D6C66122B8A3D001FD1F7 /* FileList.cpp */,
 				976D6C67122B8A3D001FD1F7 /* FileList.h */,
 				E1AB1EA814E9E27D00449E13 /* FileList.idl */,
@@ -27266,7 +27252,6 @@
 				976D6C81122B8A3D001FD1F7 /* File.h in Headers */,
 				066C772B0AB603B700238CC4 /* FileChooser.h in Headers */,
 				976D6C83122B8A3D001FD1F7 /* FileError.h in Headers */,
-				2EDF369F122C94C8002F7D4E /* FileException.h in Headers */,
 				5351D4B11DF916B4008010CD /* FileHandle.h in Headers */,
 				1A88A90517553CD7000C74F9 /* FileIconLoader.h in Headers */,
 				F55B3DBE1251F12D003EF269 /* FileInputType.h in Headers */,
@@ -27966,7 +27951,6 @@
 				8E4C96DD1AD4483500365A50 /* JSFetchResponse.h in Headers */,
 				BC00F0150E0A189500FD04E3 /* JSFile.h in Headers */,
 				2E3BC0CB117D3E0800B9409A /* JSFileError.h in Headers */,
-				898785F1122E1E87003AABDA /* JSFileException.h in Headers */,
 				BC00F0170E0A189500FD04E3 /* JSFileList.h in Headers */,
 				2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */,
 				898785F5122E1EAC003AABDA /* JSFileReaderSync.h in Headers */,
@@ -31266,7 +31250,6 @@
 				976D6C80122B8A3D001FD1F7 /* File.cpp in Sources */,
 				934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */,
 				E164A2E9191AC5BB0010737D /* FileCocoa.mm in Sources */,
-				978D07B6145A0F030096908D /* FileException.cpp in Sources */,
 				5351D4B01DF916B4008010CD /* FileHandle.cpp in Sources */,
 				1A88A90417553CD7000C74F9 /* FileIconLoader.cpp in Sources */,
 				F55B3DBD1251F12D003EF269 /* FileInputType.cpp in Sources */,
@@ -31937,7 +31920,6 @@
 				8E4C96DC1AD4483500365A50 /* JSFetchResponse.cpp in Sources */,
 				BC00F0140E0A189500FD04E3 /* JSFile.cpp in Sources */,
 				2E3BC0CA117D3E0800B9409A /* JSFileError.cpp in Sources */,
-				898785F0122E1E87003AABDA /* JSFileException.cpp in Sources */,
 				BC00F0160E0A189500FD04E3 /* JSFileList.cpp in Sources */,
 				2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */,
 				898785F4122E1EAC003AABDA /* JSFileReaderSync.cpp in Sources */,

Modified: trunk/Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp (219698 => 219699)


--- trunk/Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/bindings/js/JSDOMExceptionHandling.cpp	2017-07-20 20:35:12 UTC (rev 219699)
@@ -174,9 +174,6 @@
 #endif
         errorObject = toJS(exec, globalObject, DOMCoreException::create(description));
         break;
-    case FileExceptionType:
-        errorObject = toJS(exec, globalObject, FileException::create(description));
-        break;
     case SVGExceptionType:
         errorObject = toJS(exec, globalObject, SVGException::create(description));
         break;

Modified: trunk/Source/WebCore/dom/DOMExceptions.in (219698 => 219699)


--- trunk/Source/WebCore/dom/DOMExceptions.in	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/dom/DOMExceptions.in	2017-07-20 20:35:12 UTC (rev 219699)
@@ -1,7 +1,6 @@
 namespace=Exception
 
 DOMCoreException
-FileException
 SVGException
 XPathException
 

Deleted: trunk/Source/WebCore/fileapi/FileException.cpp (219698 => 219699)


--- trunk/Source/WebCore/fileapi/FileException.cpp	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/fileapi/FileException.cpp	2017-07-20 20:35:12 UTC (rev 219699)
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2011 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:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  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.
- * 3.  Neither the name of Apple Inc. ("Apple") 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 GOOGLE AND ITS 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 APPLE OR ITS 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.
- */
-
-#include "config.h"
-#include "FileException.h"
-
-#include "ExceptionCodeDescription.h"
-
-namespace WebCore {
-
-static struct FileExceptionNameDescription {
-    const char* const name;
-    const char* const description;
-} fileExceptions[] = {
-    { "NOT_FOUND_ERR", "A requested file or directory could not be found at the time an operation was processed." },
-    { "SECURITY_ERR", "It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources." },
-    { "ABORT_ERR", "An ongoing operation was aborted, typically with a call to abort()." },
-    { "NOT_READABLE_ERR", "The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired." },
-    { "ENCODING_ERR", "A URI supplied to the API was malformed, or the resulting Data URL has exceeded the URL length limitations for Data URLs." },
-    { "NO_MODIFICATION_ALLOWED_ERR", "An attempt was made to write to a file or directory which could not be modified due to the state of the underlying filesystem." },
-    { "INVALID_STATE_ERR", "An operation that depends on state cached in an interface object was made but the state had changed since it was read from disk." },
-    { "SYNTAX_ERR", "An invalid or unsupported argument was given, like an invalid line ending specifier." },
-    { "INVALID_MODIFICATION_ERR", "The modification request was illegal." },
-    { "QUOTA_EXCEEDED_ERR", "The operation failed because it would cause the application to exceed its storage quota." },
-    { "TYPE_MISMATCH_ERR", "The path supplied exists, but was not an entry of requested type." },
-    { "PATH_EXISTS_ERR", "An attempt was made to create a file or directory where an element already exists." }
-};
-
-bool FileException::initializeDescription(ExceptionCode ec, ExceptionCodeDescription* description)
-{
-    if (ec < FileExceptionOffset || ec > FileExceptionMax)
-        return false;
-
-    description->typeName = "DOM File";
-    description->code = ec - FileExceptionOffset;
-    description->type = FileExceptionType;
-
-    size_t tableSize = WTF_ARRAY_LENGTH(fileExceptions);
-    size_t tableIndex = ec - NOT_FOUND_ERR;
-
-    description->name = tableIndex < tableSize ? fileExceptions[tableIndex].name : 0;
-    description->description = tableIndex < tableSize ? fileExceptions[tableIndex].description : 0;
-
-    return true;
-}
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/fileapi/FileException.h (219698 => 219699)


--- trunk/Source/WebCore/fileapi/FileException.h	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/fileapi/FileException.h	2017-07-20 20:35:12 UTC (rev 219699)
@@ -1,78 +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.
- */
-
-#pragma once
-
-#include "ExceptionBase.h"
-
-namespace WebCore {
-
-class FileException : public ExceptionBase {
-public:
-    static Ref<FileException> create(const ExceptionCodeDescription& description)
-    {
-        return adoptRef(*new FileException(description));
-    }
-
-    static const int FileExceptionOffset = 1100;
-    static const int FileExceptionMax = 1199;
-
-    enum FileExceptionCode {
-        NOT_FOUND_ERR = FileExceptionOffset + 1,
-        SECURITY_ERR = FileExceptionOffset + 2,
-        ABORT_ERR = FileExceptionOffset + 3,
-        NOT_READABLE_ERR = FileExceptionOffset + 4,
-        ENCODING_ERR = FileExceptionOffset + 5,
-        NO_MODIFICATION_ALLOWED_ERR = FileExceptionOffset + 6,
-        INVALID_STATE_ERR = FileExceptionOffset + 7,
-        SYNTAX_ERR = FileExceptionOffset + 8,
-        INVALID_MODIFICATION_ERR = FileExceptionOffset + 9,
-        QUOTA_EXCEEDED_ERR = FileExceptionOffset + 10,
-        TYPE_MISMATCH_ERR = FileExceptionOffset + 11,
-        PATH_EXISTS_ERR = FileExceptionOffset + 12,
-    };
-
-    static int ErrorCodeToExceptionCode(int errorCode)
-    {
-        if (!errorCode)
-            return 0;
-        return errorCode + FileExceptionOffset;
-    }
-
-    static bool initializeDescription(ExceptionCode, ExceptionCodeDescription*);
-
-private:
-    FileException(const ExceptionCodeDescription& description)
-        : ExceptionBase(description)
-    {
-    }
-};
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/fileapi/FileException.idl (219698 => 219699)


--- trunk/Source/WebCore/fileapi/FileException.idl	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/fileapi/FileException.idl	2017-07-20 20:35:12 UTC (rev 219699)
@@ -1,55 +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.
- */
-
-[
-    DoNotCheckConstants,
-    ImplementationLacksVTable,
-    NoInterfaceObject,
-] exception FileException {
-    readonly attribute unsigned short code;
-    readonly attribute DOMString name;
-    readonly attribute DOMString message;
-
-    [NotEnumerable] DOMString toString();
-
-    // FileExceptionCode
-    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;
-};

Modified: trunk/Source/WebCore/fileapi/FileReaderLoader.cpp (219698 => 219699)


--- trunk/Source/WebCore/fileapi/FileReaderLoader.cpp	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/fileapi/FileReaderLoader.cpp	2017-07-20 20:35:12 UTC (rev 219699)
@@ -61,7 +61,6 @@
     , m_variableLength(false)
     , m_bytesLoaded(0)
     , m_totalBytes(0)
-    , m_errorCode(0)
 {
 }
 
@@ -237,7 +236,7 @@
     failed(toErrorCode(static_cast<BlobResourceHandle::Error>(error.errorCode())));
 }
 
-void FileReaderLoader::failed(int errorCode)
+void FileReaderLoader::failed(FileError::ErrorCode errorCode)
 {
     m_errorCode = errorCode;
     cleanup();

Modified: trunk/Source/WebCore/fileapi/FileReaderLoader.h (219698 => 219699)


--- trunk/Source/WebCore/fileapi/FileReaderLoader.h	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/fileapi/FileReaderLoader.h	2017-07-20 20:35:12 UTC (rev 219699)
@@ -77,7 +77,7 @@
     RefPtr<JSC::ArrayBuffer> arrayBufferResult() const;
     unsigned bytesLoaded() const { return m_bytesLoaded; }
     unsigned totalBytes() const { return m_totalBytes; }
-    int errorCode() const { return m_errorCode; }
+    FileError::ErrorCode errorCode() const { return m_errorCode; }
 
     void setEncoding(const String&);
     void setDataType(const String& dataType) { m_dataType = dataType; }
@@ -85,7 +85,7 @@
 private:
     void terminate();
     void cleanup();
-    void failed(int errorCode);
+    void failed(FileError::ErrorCode);
     void convertToText();
     void convertToDataURL();
 
@@ -115,7 +115,7 @@
     unsigned m_bytesLoaded;
     unsigned m_totalBytes;
 
-    int m_errorCode;
+    FileError::ErrorCode m_errorCode { FileError::OK };
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/fileapi/FileReaderSync.cpp (219698 => 219699)


--- trunk/Source/WebCore/fileapi/FileReaderSync.cpp	2017-07-20 20:34:29 UTC (rev 219698)
+++ trunk/Source/WebCore/fileapi/FileReaderSync.cpp	2017-07-20 20:35:12 UTC (rev 219699)
@@ -34,7 +34,7 @@
 
 #include "Blob.h"
 #include "BlobURL.h"
-#include "FileException.h"
+#include "ExceptionCode.h"
 #include "FileReaderLoader.h"
 #include <runtime/ArrayBuffer.h>
 
@@ -73,10 +73,43 @@
     return startLoadingString(scriptExecutionContext, loader, blob);
 }
 
+static ExceptionCode errorCodeToExceptionCode(FileError::ErrorCode errorCode)
+{
+    switch (errorCode) {
+    case FileError::OK:
+        return 0;
+    case FileError::NOT_FOUND_ERR:
+        return NOT_FOUND_ERR;
+    case FileError::SECURITY_ERR:
+        return SECURITY_ERR;
+    case FileError::ABORT_ERR:
+        return ABORT_ERR;
+    case FileError::NOT_READABLE_ERR:
+        return NotReadableError;
+    case FileError::ENCODING_ERR:
+        return EncodingError;
+    case FileError::NO_MODIFICATION_ALLOWED_ERR:
+        return NO_MODIFICATION_ALLOWED_ERR;
+    case FileError::INVALID_STATE_ERR:
+        return INVALID_STATE_ERR;
+    case FileError::SYNTAX_ERR:
+        return SYNTAX_ERR;
+    case FileError::INVALID_MODIFICATION_ERR:
+        return INVALID_MODIFICATION_ERR;
+    case FileError::QUOTA_EXCEEDED_ERR:
+        return QUOTA_EXCEEDED_ERR;
+    case FileError::TYPE_MISMATCH_ERR:
+        return TYPE_MISMATCH_ERR;
+    case FileError::PATH_EXISTS_ERR:
+        return NO_MODIFICATION_ALLOWED_ERR;
+    }
+    return UnknownError;
+}
+
 ExceptionOr<void> FileReaderSync::startLoading(ScriptExecutionContext& scriptExecutionContext, FileReaderLoader& loader, Blob& blob)
 {
     loader.start(&scriptExecutionContext, blob);
-    if (ExceptionCode code = FileException::ErrorCodeToExceptionCode(loader.errorCode()))
+    if (ExceptionCode code = errorCodeToExceptionCode(loader.errorCode()))
         return Exception { code };
     return { };
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to