Bug 1315185 - Get rid of FileSystemFileEntry.createWriter, r=smaug
authorAndrea Marchesini <amarchesini@mozilla.com>
Fri, 04 Nov 2016 14:23:46 +0100
changeset 347717 bee46857d60e9c531aa333aff3c504bc96588531
parent 347716 cb45e90f6596bbe9c96f1a99b690ce348c7a9321
child 347718 e4b1a95a7f3997e90a1e278b82b17140ec235af8
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
bugs1315185
milestone52.0a1
Bug 1315185 - Get rid of FileSystemFileEntry.createWriter, r=smaug
dom/filesystem/compat/FileSystemFileEntry.cpp
dom/filesystem/compat/FileSystemFileEntry.h
dom/filesystem/compat/tests/test_basic.html
dom/webidl/FileSystemFileEntry.webidl
--- a/dom/filesystem/compat/FileSystemFileEntry.cpp
+++ b/dom/filesystem/compat/FileSystemFileEntry.cpp
@@ -86,24 +86,16 @@ FileSystemFileEntry::GetFullPath(nsAStri
     nsAutoString name;
     mFile->GetName(name);
     aPath.AssignLiteral(FILESYSTEM_DOM_PATH_SEPARATOR_LITERAL);
     aPath.Append(name);
   }
 }
 
 void
-FileSystemFileEntry::CreateWriter(VoidCallback& aSuccessCallback,
-                                  const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const
-{
-  ErrorCallbackHelper::Call(GetParentObject(), aErrorCallback,
-                            NS_ERROR_DOM_SECURITY_ERR);
-}
-
-void
 FileSystemFileEntry::GetFile(FileCallback& aSuccessCallback,
                              const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const
 {
   RefPtr<FileCallbackRunnable> runnable =
     new FileCallbackRunnable(&aSuccessCallback, mFile);
   DebugOnly<nsresult> rv = NS_DispatchToMainThread(runnable);
   NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "NS_DispatchToMainThread failed");
 }
--- a/dom/filesystem/compat/FileSystemFileEntry.h
+++ b/dom/filesystem/compat/FileSystemFileEntry.h
@@ -37,20 +37,16 @@ public:
 
   virtual void
   GetName(nsAString& aName, ErrorResult& aRv) const override;
 
   virtual void
   GetFullPath(nsAString& aFullPath, ErrorResult& aRv) const override;
 
   void
-  CreateWriter(VoidCallback& aSuccessCallback,
-               const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const;
-
-  void
   GetFile(FileCallback& aSuccessCallback,
           const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const;
 
 private:
   ~FileSystemFileEntry();
 
   RefPtr<File> mFile;
 };
--- a/dom/filesystem/compat/tests/test_basic.html
+++ b/dom/filesystem/compat/tests/test_basic.html
@@ -66,25 +66,16 @@ function test_fileEntry_file() {
     ok(file, "We have a file here!");
     is(file.name, fileEntry.name, "Same file name.");
     next();
   }, function() {
     ok(false, "Something when wrong!");
   });
 }
 
-function test_fileEntry_createWriter() {
-  fileEntry.createWriter(function(file) {
-    ok(false, "Something when wrong!");
-  }, function() {
-    ok(true, "We don't support createWrite");
-    next();
-  });
-}
-
 function test_fileEntry_getParent() {
   fileEntry.getParent(function(entry) {
     is(fileEntry.fullPath, entry.fullPath, "Top level FileEntry should return itself as parent.");
     next();
   }, function() {
     ok(false, "This is wrong.");
   });
 }
@@ -420,17 +411,16 @@ function test_getParent(entry, parentEnt
 var tests = [
   setup_tests,
   populate_entries,
 
   test_entries,
 
   test_fileEntry,
   test_fileEntry_file,
-  test_fileEntry_createWriter,
   test_fileEntry_getParent,
 
   test_directoryEntry,
   test_directoryEntry_createReader,
   test_directoryEntry_getParent,
 
   test_directoryEntry_getFile_securityError,
   test_directoryEntry_getFile_typeMismatchError,
--- a/dom/webidl/FileSystemFileEntry.webidl
+++ b/dom/webidl/FileSystemFileEntry.webidl
@@ -4,17 +4,12 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
 callback interface FileCallback {
     void handleEvent(File file);
 };
 
 interface FileSystemFileEntry : FileSystemEntry {
-    // the successCallback should be a FileWriteCallback but this method is not
-    // implemented. ErrorCallback will be called with SecurityError.
-    void createWriter (VoidCallback successCallback,
-                       optional ErrorCallback errorCallback);
-
     [BinaryName="GetFile"]
     void file (FileCallback successCallback,
                optional ErrorCallback errorCallback);
 };