Bug 1284987 - Entries API - part 1 - DOMString to USVString, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Thu, 03 Nov 2016 07:55:17 +0100
changeset 347541 d3d7be05ed665f4c368cdfa11f64afd998494301
parent 347540 d126f5063e0e6d71b9add712a07eff57bbedc91e
child 347542 aed436c3876ffa54c8c19b7778cf8efdd6543703
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1284987
milestone52.0a1
Bug 1284987 - Entries API - part 1 - DOMString to USVString, r=smaug
dom/filesystem/compat/FileSystemDirectoryEntry.h
dom/webidl/File.webidl
dom/webidl/FileSystem.webidl
dom/webidl/FileSystemDirectoryEntry.webidl
dom/webidl/FileSystemEntry.webidl
--- a/dom/filesystem/compat/FileSystemDirectoryEntry.h
+++ b/dom/filesystem/compat/FileSystemDirectoryEntry.h
@@ -41,29 +41,31 @@ public:
 
   virtual void
   GetFullPath(nsAString& aFullPath, ErrorResult& aRv) const override;
 
   virtual already_AddRefed<FileSystemDirectoryReader>
   CreateReader() const;
 
   void
-  GetFile(const nsAString& aPath, const FileSystemFlags& aFlag,
+  GetFile(const Optional<nsAString>& aPath, const FileSystemFlags& aFlag,
           const Optional<OwningNonNull<FileSystemEntryCallback>>& aSuccessCallback,
           const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const
   {
-    GetInternal(aPath, aFlag, aSuccessCallback, aErrorCallback, eGetFile);
+    GetInternal(aPath.WasPassed() ? aPath.Value() : EmptyString(),
+                aFlag, aSuccessCallback, aErrorCallback, eGetFile);
   }
 
   void
-  GetDirectory(const nsAString& aPath, const FileSystemFlags& aFlag,
+  GetDirectory(const Optional<nsAString>& aPath, const FileSystemFlags& aFlag,
                const Optional<OwningNonNull<FileSystemEntryCallback>>& aSuccessCallback,
                const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const
   {
-    GetInternal(aPath, aFlag, aSuccessCallback, aErrorCallback, eGetDirectory);
+    GetInternal(aPath.WasPassed() ? aPath.Value() : EmptyString(),
+                aFlag, aSuccessCallback, aErrorCallback, eGetDirectory);
   }
 
   void
   RemoveRecursively(VoidCallback& aSuccessCallback,
                     const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const;
 
   enum GetInternalType { eGetFile, eGetDirectory };
 
--- a/dom/webidl/File.webidl
+++ b/dom/webidl/File.webidl
@@ -36,13 +36,13 @@ dictionary ChromeFilePropertyBag : FileP
 };
 
 // Mozilla extensions
 partial interface File {
   [GetterThrows, Deprecated="FileLastModifiedDate"]
   readonly attribute Date lastModifiedDate;
 
   [BinaryName="path", Func="mozilla::dom::Directory::WebkitBlinkDirectoryPickerEnabled"]
-  readonly attribute DOMString webkitRelativePath;
+  readonly attribute USVString webkitRelativePath;
 
   [GetterThrows, ChromeOnly]
   readonly attribute DOMString mozFullPath;
 };
--- a/dom/webidl/FileSystem.webidl
+++ b/dom/webidl/FileSystem.webidl
@@ -19,11 +19,11 @@ callback interface VoidCallback {
 };
 
 callback interface ErrorCallback {
     // This should be FileError but we are implementing just a subset of this API.
     void handleEvent(DOMError error);
 };
 
 interface FileSystem {
-    readonly    attribute DOMString name;
+    readonly    attribute USVString name;
     readonly    attribute FileSystemDirectoryEntry root;
 };
--- a/dom/webidl/FileSystemDirectoryEntry.webidl
+++ b/dom/webidl/FileSystemDirectoryEntry.webidl
@@ -2,22 +2,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 interface FileSystemDirectoryEntry : FileSystemEntry {
     FileSystemDirectoryReader createReader();
 
-    void getFile(DOMString? path,
+    void getFile(optional USVString? path,
                  optional FileSystemFlags options,
                  optional FileSystemEntryCallback successCallback,
                  optional ErrorCallback errorCallback);
 
-    void getDirectory(DOMString? path,
+    void getDirectory(optional USVString? path,
                       optional FileSystemFlags options,
                       optional FileSystemEntryCallback successCallback,
                       optional ErrorCallback errorCallback);
 
     // This method is not implemented. ErrorCallback will be called
     // with SecurityError
     void removeRecursively(VoidCallback successCallback,
                            optional ErrorCallback errorCallback);
--- a/dom/webidl/FileSystemEntry.webidl
+++ b/dom/webidl/FileSystemEntry.webidl
@@ -4,31 +4,20 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 interface FileSystemEntry {
     readonly attribute boolean isFile;
     readonly attribute boolean isDirectory;
 
     [GetterThrows]
-    readonly attribute DOMString name;
+    readonly attribute USVString name;
 
     [GetterThrows]
-    readonly attribute DOMString fullPath;
+    readonly attribute USVString fullPath;
 
     readonly attribute FileSystem filesystem;
 
 /** Not implemented:
- *  void getMetadata(MetadataCallback successCallback,
- *                   optional ErrorCallback errorCallback);
- *  void moveTo(FileSystemDirectoryEntry parent, optional DOMString? name,
- *              optional FileSystemEntryCallback successCallback,
- *              optional ErrorCallback errorCallback);
- *  void copyTo(FileSystemDirectoryEntry parent, optional DOMString? name,
- *              optional FileSystemEntryCallback successCallback,
- *              optional ErrorCallback errorCallback);
- *  DOMString toURL();
- *  void remove(VoidCallback successCallback,
- *              optional ErrorCallback errorCallback);
  *  void getParent(optional FileSystemEntryCallback successCallback,
  *                 optional ErrorCallback errorCallback);
  */
 };