Bug 1367560 - Remove an assertion from the Directory constructor that the directory exists on disk from DEBUG builds; r?baku draft
authorAlex Gaynor <agaynor@mozilla.com>
Tue, 06 Jun 2017 10:15:13 -0400
changeset 589620 3bcaaf8f5107
parent 589544 4dd1d17ba226
child 631958 ad5970f4056d
push id62454
push userbmo:agaynor@mozilla.com
push dateTue, 06 Jun 2017 14:18:48 +0000
reviewersbaku
bugs1367560
milestone55.0a1
Bug 1367560 - Remove an assertion from the Directory constructor that the directory exists on disk from DEBUG builds; r?baku As long as Directory objects can be constructed in the content process, trying to access the file system conceptually does not make sense because of sandboxing. The canary in the coal mine for this was tests which started crashing on Directory construction as we further locked down read access in the sandbox. MozReview-Commit-ID: HZitALYpO5H
dom/filesystem/Directory.cpp
--- a/dom/filesystem/Directory.cpp
+++ b/dom/filesystem/Directory.cpp
@@ -81,22 +81,16 @@ Directory::Constructor(const GlobalObjec
 
 /* static */ already_AddRefed<Directory>
 Directory::Create(nsISupports* aParent, nsIFile* aFile,
                   FileSystemBase* aFileSystem)
 {
   MOZ_ASSERT(aParent);
   MOZ_ASSERT(aFile);
 
-#ifdef DEBUG
-  bool isDir;
-  nsresult rv = aFile->IsDirectory(&isDir);
-  MOZ_ASSERT(NS_SUCCEEDED(rv) && isDir);
-#endif
-
   RefPtr<Directory> directory = new Directory(aParent, aFile, aFileSystem);
   return directory.forget();
 }
 
 Directory::Directory(nsISupports* aParent,
                      nsIFile* aFile,
                      FileSystemBase* aFileSystem)
   : mParent(aParent)