author | Andrea Marchesini <amarchesini@mozilla.com> |
Thu, 18 Aug 2016 09:18:05 +0200 | |
changeset 310078 | e3deb006faab39474833bc3e08540e3f3b123c19 |
parent 310077 | a5f5a110ff9eb8cb86419e4bf3e453873fca96d0 |
child 310079 | 4a589e795dcf0942de5cef5361ec41c8b9d73a5a |
push id | 30576 |
push user | ryanvm@gmail.com |
push date | Fri, 19 Aug 2016 13:53:39 +0000 |
treeherder | mozilla-central@74f332c38a69 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | smaug |
bugs | 1295570 |
milestone | 51.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/events/DataTransferItem.cpp +++ b/dom/events/DataTransferItem.cpp @@ -5,19 +5,19 @@ #include "DataTransferItem.h" #include "DataTransferItemList.h" #include "mozilla/ContentEvents.h" #include "mozilla/EventForwards.h" #include "mozilla/dom/DataTransferItemBinding.h" #include "mozilla/dom/Directory.h" -#include "mozilla/dom/DirectoryEntry.h" #include "mozilla/dom/Event.h" #include "mozilla/dom/FileSystem.h" +#include "mozilla/dom/FileSystemDirectoryEntry.h" #include "mozilla/dom/FileSystemFileEntry.h" #include "nsIClipboard.h" #include "nsISupportsPrimitives.h" #include "nsNetUtil.h" #include "nsQueryObject.h" #include "nsContentUtils.h" #include "nsVariant.h" @@ -324,17 +324,17 @@ DataTransferItem::GetAsEntry(ErrorResult nsCOMPtr<nsIFile> directoryFile; nsresult rv = NS_NewNativeLocalFile(NS_ConvertUTF16toUTF8(fullpath), true, getter_AddRefs(directoryFile)); if (NS_WARN_IF(NS_FAILED(rv))) { return nullptr; } RefPtr<Directory> directory = Directory::Create(global, directoryFile); - entry = new DirectoryEntry(global, directory, fs); + entry = new FileSystemDirectoryEntry(global, directory, fs); } else { entry = new FileSystemFileEntry(global, file, fs); } Sequence<RefPtr<FileSystemEntry>> entries; if (!entries.AppendElement(entry, fallible)) { return nullptr; }
--- a/dom/filesystem/compat/CallbackRunnables.cpp +++ b/dom/filesystem/compat/CallbackRunnables.cpp @@ -71,17 +71,17 @@ EmptyEntriesCallbackRunnable::Run() mCallback->HandleEvent(sequence); return NS_OK; } GetEntryHelper::GetEntryHelper(nsIGlobalObject* aGlobalObject, FileSystem* aFileSystem, EntryCallback* aSuccessCallback, ErrorCallback* aErrorCallback, - DirectoryEntry::GetInternalType aType) + FileSystemDirectoryEntry::GetInternalType aType) : mGlobal(aGlobalObject) , mFileSystem(aFileSystem) , mSuccessCallback(aSuccessCallback) , mErrorCallback(aErrorCallback) , mType(aType) { MOZ_ASSERT(aGlobalObject); MOZ_ASSERT(aFileSystem); @@ -95,39 +95,39 @@ void GetEntryHelper::ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) { if(NS_WARN_IF(!aValue.isObject())) { return; } JS::Rooted<JSObject*> obj(aCx, &aValue.toObject()); - if (mType == DirectoryEntry::eGetFile) { + if (mType == FileSystemDirectoryEntry::eGetFile) { RefPtr<File> file; if (NS_FAILED(UNWRAP_OBJECT(File, obj, file))) { Error(NS_ERROR_DOM_TYPE_MISMATCH_ERR); return; } RefPtr<FileSystemFileEntry> entry = new FileSystemFileEntry(mGlobal, file, mFileSystem); mSuccessCallback->HandleEvent(*entry); return; } - MOZ_ASSERT(mType == DirectoryEntry::eGetDirectory); + MOZ_ASSERT(mType == FileSystemDirectoryEntry::eGetDirectory); RefPtr<Directory> directory; if (NS_FAILED(UNWRAP_OBJECT(Directory, obj, directory))) { Error(NS_ERROR_DOM_TYPE_MISMATCH_ERR); return; } - RefPtr<DirectoryEntry> entry = - new DirectoryEntry(mGlobal, directory, mFileSystem); + RefPtr<FileSystemDirectoryEntry> entry = + new FileSystemDirectoryEntry(mGlobal, directory, mFileSystem); mSuccessCallback->HandleEvent(*entry); } void GetEntryHelper::RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) { Error(NS_ERROR_DOM_NOT_FOUND_ERR); }
--- a/dom/filesystem/compat/CallbackRunnables.h +++ b/dom/filesystem/compat/CallbackRunnables.h @@ -2,17 +2,17 @@ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */ #ifndef mozilla_dom_ErrorCallbackRunnable_h #define mozilla_dom_ErrorCallbackRunnable_h -#include "DirectoryEntry.h" +#include "FileSystemDirectoryEntry.h" #include "mozilla/dom/BindingDeclarations.h" #include "mozilla/dom/PromiseNativeHandler.h" class nsIGlobalObject; namespace mozilla { namespace dom { @@ -62,17 +62,17 @@ class GetEntryHelper final : public Prom { public: NS_DECL_ISUPPORTS GetEntryHelper(nsIGlobalObject* aGlobalObject, FileSystem* aFileSystem, EntryCallback* aSuccessCallback, ErrorCallback* aErrorCallback, - DirectoryEntry::GetInternalType aType); + FileSystemDirectoryEntry::GetInternalType aType); virtual void ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override; virtual void RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override; private: @@ -80,17 +80,17 @@ private: void Error(nsresult aError); nsCOMPtr<nsIGlobalObject> mGlobal; RefPtr<FileSystem> mFileSystem; RefPtr<EntryCallback> mSuccessCallback; RefPtr<ErrorCallback> mErrorCallback; - DirectoryEntry::GetInternalType mType; + FileSystemDirectoryEntry::GetInternalType mType; }; class ErrorCallbackHelper { public: static void Call(nsIGlobalObject* aGlobal, const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback,
--- a/dom/filesystem/compat/DirectoryReader.cpp +++ b/dom/filesystem/compat/DirectoryReader.cpp @@ -78,18 +78,18 @@ public: } RefPtr<Directory> directory; if (NS_WARN_IF(NS_FAILED(UNWRAP_OBJECT(Directory, valueObj, directory)))) { return; } - RefPtr<DirectoryEntry> entry = - new DirectoryEntry(mGlobal, directory, mFileSystem); + RefPtr<FileSystemDirectoryEntry> entry = + new FileSystemDirectoryEntry(mGlobal, directory, mFileSystem); sequence[i] = entry; } mSuccessCallback->HandleEvent(sequence); } virtual void RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override
--- a/dom/filesystem/compat/FileSystem.cpp +++ b/dom/filesystem/compat/FileSystem.cpp @@ -1,16 +1,16 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */ #include "FileSystem.h" -#include "RootDirectoryEntry.h" +#include "FileSystemRootDirectoryEntry.h" #include "mozilla/dom/FileSystemBinding.h" #include "nsContentUtils.h" namespace mozilla { namespace dom { NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FileSystem, mParent, mRoot) @@ -63,13 +63,13 @@ FileSystem::WrapObject(JSContext* aCx, J { return FileSystemBinding::Wrap(aCx, this, aGivenProto); } void FileSystem::CreateRoot(const Sequence<RefPtr<FileSystemEntry>>& aEntries) { MOZ_ASSERT(!mRoot); - mRoot = new RootDirectoryEntry(mParent, aEntries, this); + mRoot = new FileSystemRootDirectoryEntry(mParent, aEntries, this); } } // dom namespace } // mozilla namespace
--- a/dom/filesystem/compat/FileSystem.h +++ b/dom/filesystem/compat/FileSystem.h @@ -13,17 +13,17 @@ #include "nsCycleCollectionParticipant.h" #include "nsWrapperCache.h" class nsIGlobalObject; namespace mozilla { namespace dom { -class DirectoryEntry; +class FileSystemDirectoryEntry; class FileSystemEntry; class OwningFileOrDirectory; class FileSystem final : public nsISupports , public nsWrapperCache { public: @@ -43,31 +43,31 @@ public: WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; void GetName(nsAString& aName) const { aName = mName; } - DirectoryEntry* + FileSystemDirectoryEntry* Root() const { return mRoot; } void CreateRoot(const Sequence<RefPtr<FileSystemEntry>>& aEntries); private: explicit FileSystem(nsIGlobalObject* aGlobalObject, const nsAString& aName); ~FileSystem(); nsCOMPtr<nsIGlobalObject> mParent; - RefPtr<DirectoryEntry> mRoot; + RefPtr<FileSystemDirectoryEntry> mRoot; nsString mName; }; } // namespace dom } // namespace mozilla #endif // mozilla_dom_FileSystem_h
rename from dom/filesystem/compat/DirectoryEntry.cpp rename to dom/filesystem/compat/FileSystemDirectoryEntry.cpp --- a/dom/filesystem/compat/DirectoryEntry.cpp +++ b/dom/filesystem/compat/FileSystemDirectoryEntry.cpp @@ -1,78 +1,81 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */ -#include "DirectoryEntry.h" +#include "FileSystemDirectoryEntry.h" #include "CallbackRunnables.h" #include "DirectoryReader.h" #include "mozilla/dom/Directory.h" #include "mozilla/dom/FileSystemUtils.h" namespace mozilla { namespace dom { -NS_IMPL_CYCLE_COLLECTION_INHERITED(DirectoryEntry, FileSystemEntry, mDirectory) +NS_IMPL_CYCLE_COLLECTION_INHERITED(FileSystemDirectoryEntry, FileSystemEntry, + mDirectory) -NS_IMPL_ADDREF_INHERITED(DirectoryEntry, FileSystemEntry) -NS_IMPL_RELEASE_INHERITED(DirectoryEntry, FileSystemEntry) +NS_IMPL_ADDREF_INHERITED(FileSystemDirectoryEntry, FileSystemEntry) +NS_IMPL_RELEASE_INHERITED(FileSystemDirectoryEntry, FileSystemEntry) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DirectoryEntry) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(FileSystemDirectoryEntry) NS_INTERFACE_MAP_END_INHERITING(FileSystemEntry) -DirectoryEntry::DirectoryEntry(nsIGlobalObject* aGlobal, - Directory* aDirectory, - FileSystem* aFileSystem) +FileSystemDirectoryEntry::FileSystemDirectoryEntry(nsIGlobalObject* aGlobal, + Directory* aDirectory, + FileSystem* aFileSystem) : FileSystemEntry(aGlobal, aFileSystem) , mDirectory(aDirectory) { MOZ_ASSERT(aGlobal); } -DirectoryEntry::~DirectoryEntry() +FileSystemDirectoryEntry::~FileSystemDirectoryEntry() {} JSObject* -DirectoryEntry::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) +FileSystemDirectoryEntry::WrapObject(JSContext* aCx, + JS::Handle<JSObject*> aGivenProto) { - return DirectoryEntryBinding::Wrap(aCx, this, aGivenProto); + return FileSystemDirectoryEntryBinding::Wrap(aCx, this, aGivenProto); } void -DirectoryEntry::GetName(nsAString& aName, ErrorResult& aRv) const +FileSystemDirectoryEntry::GetName(nsAString& aName, ErrorResult& aRv) const { MOZ_ASSERT(mDirectory); mDirectory->GetName(aName, aRv); } void -DirectoryEntry::GetFullPath(nsAString& aPath, ErrorResult& aRv) const +FileSystemDirectoryEntry::GetFullPath(nsAString& aPath, ErrorResult& aRv) const { MOZ_ASSERT(mDirectory); mDirectory->GetPath(aPath, aRv); } already_AddRefed<DirectoryReader> -DirectoryEntry::CreateReader() const +FileSystemDirectoryEntry::CreateReader() const { MOZ_ASSERT(mDirectory); RefPtr<DirectoryReader> reader = new DirectoryReader(GetParentObject(), Filesystem(), mDirectory); return reader.forget(); } void -DirectoryEntry::GetInternal(const nsAString& aPath, const FileSystemFlags& aFlag, - const Optional<OwningNonNull<EntryCallback>>& aSuccessCallback, - const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback, - GetInternalType aType) const +FileSystemDirectoryEntry::GetInternal(const nsAString& aPath, + const FileSystemFlags& aFlag, + const Optional<OwningNonNull<EntryCallback>>& aSuccessCallback, + const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback, + GetInternalType aType) const { MOZ_ASSERT(mDirectory); if (!aSuccessCallback.WasPassed() && !aErrorCallback.WasPassed()) { return; } if (aFlag.mCreate) { @@ -102,17 +105,17 @@ DirectoryEntry::GetInternal(const nsAStr ? &aSuccessCallback.Value() : nullptr, aErrorCallback.WasPassed() ? &aErrorCallback.Value() : nullptr, aType); promise->AppendNativeHandler(handler); } void -DirectoryEntry::RemoveRecursively(VoidCallback& aSuccessCallback, - const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const +FileSystemDirectoryEntry::RemoveRecursively(VoidCallback& aSuccessCallback, + const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback) const { ErrorCallbackHelper::Call(GetParentObject(), aErrorCallback, NS_ERROR_DOM_SECURITY_ERR); } } // dom namespace } // mozilla namespace
rename from dom/filesystem/compat/DirectoryEntry.h rename to dom/filesystem/compat/FileSystemDirectoryEntry.h --- a/dom/filesystem/compat/DirectoryEntry.h +++ b/dom/filesystem/compat/FileSystemDirectoryEntry.h @@ -1,33 +1,35 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */ -#ifndef mozilla_dom_DirectoryEntry_h -#define mozilla_dom_DirectoryEntry_h +#ifndef mozilla_dom_FileSystemDirectoryEntry_h +#define mozilla_dom_FileSystemDirectoryEntry_h #include "mozilla/dom/FileSystemBinding.h" #include "mozilla/dom/FileSystemEntry.h" namespace mozilla { namespace dom { class Directory; -class DirectoryEntry : public FileSystemEntry +class FileSystemDirectoryEntry : public FileSystemEntry { public: NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DirectoryEntry, FileSystemEntry) + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileSystemDirectoryEntry, + FileSystemEntry) - DirectoryEntry(nsIGlobalObject* aGlobalObject, Directory* aDirectory, - FileSystem* aFileSystem); + FileSystemDirectoryEntry(nsIGlobalObject* aGlobalObject, + Directory* aDirectory, + FileSystem* aFileSystem); virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; virtual bool IsDirectory() const override { return true; @@ -66,18 +68,18 @@ public: virtual void GetInternal(const nsAString& aPath, const FileSystemFlags& aFlag, const Optional<OwningNonNull<EntryCallback>>& aSuccessCallback, const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback, GetInternalType aType) const; protected: - virtual ~DirectoryEntry(); + virtual ~FileSystemDirectoryEntry(); private: RefPtr<Directory> mDirectory; }; } // namespace dom } // namespace mozilla -#endif // mozilla_dom_DirectoryEntry_h +#endif // mozilla_dom_FileSystemDirectoryEntry_h
--- a/dom/filesystem/compat/FileSystemEntry.cpp +++ b/dom/filesystem/compat/FileSystemEntry.cpp @@ -1,16 +1,16 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */ #include "FileSystemEntry.h" -#include "DirectoryEntry.h" +#include "FileSystemDirectoryEntry.h" #include "FileSystemFileEntry.h" #include "mozilla/dom/UnionTypes.h" namespace mozilla { namespace dom { NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FileSystemEntry, mParent, mFileSystem) @@ -32,19 +32,19 @@ FileSystemEntry::Create(nsIGlobalObject* RefPtr<FileSystemEntry> entry; if (aFileOrDirectory.IsFile()) { entry = new FileSystemFileEntry(aGlobalObject, aFileOrDirectory.GetAsFile(), aFileSystem); } else { MOZ_ASSERT(aFileOrDirectory.IsDirectory()); - entry = new DirectoryEntry(aGlobalObject, - aFileOrDirectory.GetAsDirectory(), - aFileSystem); + entry = new FileSystemDirectoryEntry(aGlobalObject, + aFileOrDirectory.GetAsDirectory(), + aFileSystem); } return entry.forget(); } FileSystemEntry::FileSystemEntry(nsIGlobalObject* aGlobal, FileSystem* aFileSystem) : mParent(aGlobal)
rename from dom/filesystem/compat/RootDirectoryEntry.cpp rename to dom/filesystem/compat/FileSystemRootDirectoryEntry.cpp --- a/dom/filesystem/compat/RootDirectoryEntry.cpp +++ b/dom/filesystem/compat/FileSystemRootDirectoryEntry.cpp @@ -1,66 +1,68 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */ -#include "RootDirectoryEntry.h" +#include "FileSystemRootDirectoryEntry.h" #include "RootDirectoryReader.h" #include "mozilla/dom/FileSystemUtils.h" namespace mozilla { namespace dom { -NS_IMPL_CYCLE_COLLECTION_INHERITED(RootDirectoryEntry, DirectoryEntry, mEntries) +NS_IMPL_CYCLE_COLLECTION_INHERITED(FileSystemRootDirectoryEntry, + FileSystemDirectoryEntry, mEntries) -NS_IMPL_ADDREF_INHERITED(RootDirectoryEntry, DirectoryEntry) -NS_IMPL_RELEASE_INHERITED(RootDirectoryEntry, DirectoryEntry) +NS_IMPL_ADDREF_INHERITED(FileSystemRootDirectoryEntry, FileSystemDirectoryEntry) +NS_IMPL_RELEASE_INHERITED(FileSystemRootDirectoryEntry, FileSystemDirectoryEntry) -NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(RootDirectoryEntry) -NS_INTERFACE_MAP_END_INHERITING(DirectoryEntry) +NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(FileSystemRootDirectoryEntry) +NS_INTERFACE_MAP_END_INHERITING(FileSystemDirectoryEntry) -RootDirectoryEntry::RootDirectoryEntry(nsIGlobalObject* aGlobal, - const Sequence<RefPtr<FileSystemEntry>>& aEntries, - FileSystem* aFileSystem) - : DirectoryEntry(aGlobal, nullptr, aFileSystem) +FileSystemRootDirectoryEntry::FileSystemRootDirectoryEntry(nsIGlobalObject* aGlobal, + const Sequence<RefPtr<FileSystemEntry>>& aEntries, + FileSystem* aFileSystem) + : FileSystemDirectoryEntry(aGlobal, nullptr, aFileSystem) , mEntries(aEntries) { MOZ_ASSERT(aGlobal); } -RootDirectoryEntry::~RootDirectoryEntry() +FileSystemRootDirectoryEntry::~FileSystemRootDirectoryEntry() {} void -RootDirectoryEntry::GetName(nsAString& aName, ErrorResult& aRv) const +FileSystemRootDirectoryEntry::GetName(nsAString& aName, ErrorResult& aRv) const { aName.Truncate(); } void -RootDirectoryEntry::GetFullPath(nsAString& aPath, ErrorResult& aRv) const +FileSystemRootDirectoryEntry::GetFullPath(nsAString& aPath, ErrorResult& aRv) const { aPath.AssignLiteral(FILESYSTEM_DOM_PATH_SEPARATOR_LITERAL); } already_AddRefed<DirectoryReader> -RootDirectoryEntry::CreateReader() const +FileSystemRootDirectoryEntry::CreateReader() const { RefPtr<DirectoryReader> reader = new RootDirectoryReader(GetParentObject(), Filesystem(), mEntries); return reader.forget(); } void -RootDirectoryEntry::GetInternal(const nsAString& aPath, const FileSystemFlags& aFlag, - const Optional<OwningNonNull<EntryCallback>>& aSuccessCallback, - const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback, - GetInternalType aType) const +FileSystemRootDirectoryEntry::GetInternal(const nsAString& aPath, + const FileSystemFlags& aFlag, + const Optional<OwningNonNull<EntryCallback>>& aSuccessCallback, + const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback, + GetInternalType aType) const { if (!aSuccessCallback.WasPassed() && !aErrorCallback.WasPassed()) { return; } if (aFlag.mCreate) { ErrorCallbackHelper::Call(GetParentObject(), aErrorCallback, NS_ERROR_DOM_SECURITY_ERR); @@ -130,15 +132,15 @@ RootDirectoryEntry::GetInternal(const ns nsAutoString path; for (uint32_t i = 1, len = parts.Length(); i < len; ++i) { path.Append(parts[i]); if (i < len - 1) { path.AppendLiteral(FILESYSTEM_DOM_PATH_SEPARATOR_LITERAL); } } - auto* directoryEntry = static_cast<DirectoryEntry*>(entry.get()); + auto* directoryEntry = static_cast<FileSystemDirectoryEntry*>(entry.get()); directoryEntry->GetInternal(path, aFlag, aSuccessCallback, aErrorCallback, aType); } } // dom namespace } // mozilla namespace
rename from dom/filesystem/compat/RootDirectoryEntry.h rename to dom/filesystem/compat/FileSystemRootDirectoryEntry.h --- a/dom/filesystem/compat/RootDirectoryEntry.h +++ b/dom/filesystem/compat/FileSystemRootDirectoryEntry.h @@ -1,43 +1,43 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* 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/. */ -#ifndef mozilla_dom_RootDirectoryEntry_h -#define mozilla_dom_RootDirectoryEntry_h +#ifndef mozilla_dom_FileSystemRootDirectoryEntry_h +#define mozilla_dom_FileSystemRootDirectoryEntry_h -#include "mozilla/dom/DirectoryEntry.h" +#include "mozilla/dom/FileSystemDirectoryEntry.h" namespace mozilla { namespace dom { -class RootDirectoryEntry final : public DirectoryEntry +class FileSystemRootDirectoryEntry final : public FileSystemDirectoryEntry { public: NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(RootDirectoryEntry, DirectoryEntry) + NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileSystemRootDirectoryEntry, FileSystemDirectoryEntry) - RootDirectoryEntry(nsIGlobalObject* aGlobalObject, - const Sequence<RefPtr<FileSystemEntry>>& aEntries, - FileSystem* aFileSystem); + FileSystemRootDirectoryEntry(nsIGlobalObject* aGlobalObject, + const Sequence<RefPtr<FileSystemEntry>>& aEntries, + FileSystem* aFileSystem); virtual void GetName(nsAString& aName, ErrorResult& aRv) const override; virtual void GetFullPath(nsAString& aFullPath, ErrorResult& aRv) const override; virtual already_AddRefed<DirectoryReader> CreateReader() const override; private: - ~RootDirectoryEntry(); + ~FileSystemRootDirectoryEntry(); virtual void GetInternal(const nsAString& aPath, const FileSystemFlags& aFlag, const Optional<OwningNonNull<EntryCallback>>& aSuccessCallback, const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback, GetInternalType aType) const override; void @@ -45,9 +45,9 @@ private: nsresult aError) const; Sequence<RefPtr<FileSystemEntry>> mEntries; }; } // namespace dom } // namespace mozilla -#endif // mozilla_dom_RootDirectoryEntry_h +#endif // mozilla_dom_FileSystemRootDirectoryEntry_h
--- a/dom/filesystem/compat/moz.build +++ b/dom/filesystem/compat/moz.build @@ -2,29 +2,29 @@ # vim: set filetype=python: # 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/. TEST_DIRS += ['tests'] EXPORTS.mozilla.dom += [ - 'DirectoryEntry.h', 'DirectoryReader.h', 'FileSystem.h', + 'FileSystemDirectoryEntry.h', 'FileSystemEntry.h', 'FileSystemFileEntry.h', ] UNIFIED_SOURCES += [ 'CallbackRunnables.cpp', - 'DirectoryEntry.cpp', 'DirectoryReader.cpp', 'FileSystem.cpp', + 'FileSystemDirectoryEntry.cpp', 'FileSystemEntry.cpp', 'FileSystemFileEntry.cpp', - 'RootDirectoryEntry.cpp', + 'FileSystemRootDirectoryEntry.cpp', 'RootDirectoryReader.cpp', ] FINAL_LIBRARY = 'xul' include('/ipc/chromium/chromium-config.mozbuild')
--- a/dom/webidl/FileSystem.webidl +++ b/dom/webidl/FileSystem.webidl @@ -14,18 +14,18 @@ interface FileSystemEntry { [GetterThrows] readonly attribute DOMString fullPath; readonly attribute FileSystem filesystem; /** Not implemented: * void getMetadata(MetadataCallback successCallback, optional ErrorCallback errorCallback); - * void moveTo(DirectoryEntry parent, optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback); - * void copyTo(DirectoryEntry parent, optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback); + * void moveTo(FileSystemDirectoryEntry parent, optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback); + * void copyTo(FileSystemDirectoryEntry parent, optional DOMString? name, optional EntryCallback successCallback, optional ErrorCallback errorCallback); * DOMString toURL(); * void remove(VoidCallback successCallback, optional ErrorCallback errorCallback); * void getParent(optional EntryCallback successCallback, optional ErrorCallback errorCallback); */ }; dictionary FileSystemFlags { boolean create = false; @@ -36,17 +36,17 @@ callback interface EntryCallback { void handleEvent(FileSystemEntry entry); }; callback interface VoidCallback { void handleEvent(); }; [NoInterfaceObject] -interface DirectoryEntry : FileSystemEntry { +interface FileSystemDirectoryEntry : FileSystemEntry { DirectoryReader createReader(); void getFile(DOMString? path, optional FileSystemFlags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback); void getDirectory(DOMString? path, optional FileSystemFlags options, optional EntryCallback successCallback, optional ErrorCallback errorCallback); // This method is not implemented. ErrorCallback will be called with // NS_ERROR_DOM_NOT_SUPPORTED_ERR. @@ -83,11 +83,11 @@ interface FileSystemFileEntry : FileSyst void createWriter (VoidCallback successCallback, optional ErrorCallback errorCallback); [BinaryName="GetFile"] void file (BlobCallback successCallback, optional ErrorCallback errorCallback); }; [NoInterfaceObject] interface FileSystem { - readonly attribute DOMString name; - readonly attribute DirectoryEntry root; + readonly attribute DOMString name; + readonly attribute FileSystemDirectoryEntry root; };