зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1047483 - patch 2 - Renaming nsDOMFileList to FileList, r=ehsan
This commit is contained in:
Родитель
d272279126
Коммит
78eb44f2cd
|
@ -61,7 +61,6 @@ class DOMFileImpl;
|
|||
/* FOLLOWUP TODO:
|
||||
1. remove nsDOMBlobBuilder.h
|
||||
2. rename nsDOMFile.h/cpp to DOMFile.h/cpp
|
||||
3. rename nsDOMFileList to DOMFileList
|
||||
*/
|
||||
class DOMFile MOZ_FINAL : public nsIDOMFile
|
||||
, public nsIXHRSendable
|
||||
|
@ -802,18 +801,18 @@ private:
|
|||
bool mStoredFile;
|
||||
};
|
||||
|
||||
class nsDOMFileList MOZ_FINAL : public nsIDOMFileList,
|
||||
public nsWrapperCache
|
||||
class FileList MOZ_FINAL : public nsIDOMFileList,
|
||||
public nsWrapperCache
|
||||
{
|
||||
~nsDOMFileList() {}
|
||||
~FileList() {}
|
||||
|
||||
public:
|
||||
explicit nsDOMFileList(nsISupports *aParent) : mParent(aParent)
|
||||
explicit FileList(nsISupports *aParent) : mParent(aParent)
|
||||
{
|
||||
}
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMFileList)
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileList)
|
||||
|
||||
NS_DECL_NSIDOMFILELIST
|
||||
|
||||
|
@ -842,7 +841,7 @@ public:
|
|||
|
||||
void Clear() { return mFiles.Clear(); }
|
||||
|
||||
static nsDOMFileList* FromSupports(nsISupports* aSupports)
|
||||
static FileList* FromSupports(nsISupports* aSupports)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
{
|
||||
|
@ -856,7 +855,7 @@ public:
|
|||
}
|
||||
#endif
|
||||
|
||||
return static_cast<nsDOMFileList*>(aSupports);
|
||||
return static_cast<FileList*>(aSupports);
|
||||
}
|
||||
|
||||
DOMFile* Item(uint32_t aIndex)
|
||||
|
|
|
@ -1205,27 +1205,27 @@ DOMFileImplTemporaryFileBlob::GetInternalStream(nsIInputStream** aStream)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// nsDOMFileList implementation
|
||||
// FileList implementation
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMFileList, mFiles)
|
||||
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(FileList, mFiles)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsDOMFileList)
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FileList)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMFileList)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMFileList)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMFileList)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMFileList)
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(FileList)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(FileList)
|
||||
|
||||
JSObject*
|
||||
nsDOMFileList::WrapObject(JSContext *cx)
|
||||
FileList::WrapObject(JSContext *cx)
|
||||
{
|
||||
return mozilla::dom::FileListBinding::Wrap(cx, this);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMFileList::GetLength(uint32_t* aLength)
|
||||
FileList::GetLength(uint32_t* aLength)
|
||||
{
|
||||
*aLength = Length();
|
||||
|
||||
|
@ -1233,7 +1233,7 @@ nsDOMFileList::GetLength(uint32_t* aLength)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDOMFileList::Item(uint32_t aIndex, nsIDOMFile **aFile)
|
||||
FileList::Item(uint32_t aIndex, nsIDOMFile **aFile)
|
||||
{
|
||||
nsRefPtr<DOMFile> file = Item(aIndex);
|
||||
file.forget(aFile);
|
||||
|
|
|
@ -2587,7 +2587,7 @@ void
|
|||
HTMLInputElement::SetFiles(nsIDOMFileList* aFiles,
|
||||
bool aSetValueChanged)
|
||||
{
|
||||
nsRefPtr<nsDOMFileList> files = static_cast<nsDOMFileList*>(aFiles);
|
||||
nsRefPtr<FileList> files = static_cast<FileList*>(aFiles);
|
||||
mFiles.Clear();
|
||||
|
||||
if (aFiles) {
|
||||
|
@ -2642,7 +2642,7 @@ HTMLInputElement::FireChangeEventIfNeeded()
|
|||
false);
|
||||
}
|
||||
|
||||
nsDOMFileList*
|
||||
FileList*
|
||||
HTMLInputElement::GetFiles()
|
||||
{
|
||||
if (mType != NS_FORM_INPUT_FILE) {
|
||||
|
@ -2650,7 +2650,7 @@ HTMLInputElement::GetFiles()
|
|||
}
|
||||
|
||||
if (!mFileList) {
|
||||
mFileList = new nsDOMFileList(static_cast<nsIContent*>(this));
|
||||
mFileList = new FileList(static_cast<nsIContent*>(this));
|
||||
UpdateFileList();
|
||||
}
|
||||
|
||||
|
@ -5377,7 +5377,7 @@ HTMLInputElement::SetSelectionEnd(int32_t aSelectionEnd)
|
|||
NS_IMETHODIMP
|
||||
HTMLInputElement::GetFiles(nsIDOMFileList** aFileList)
|
||||
{
|
||||
nsRefPtr<nsDOMFileList> list = GetFiles();
|
||||
nsRefPtr<FileList> list = GetFiles();
|
||||
list.forget(aFileList);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace dom {
|
|||
class Date;
|
||||
class DirPickerFileListBuilderTask;
|
||||
class DOMFile;
|
||||
class nsDOMFileList;
|
||||
class FileList;
|
||||
|
||||
class UploadLastDir MOZ_FINAL : public nsIObserver, public nsSupportsWeakReference {
|
||||
|
||||
|
@ -433,7 +433,7 @@ public:
|
|||
|
||||
// XPCOM GetForm() is OK
|
||||
|
||||
nsDOMFileList* GetFiles();
|
||||
FileList* GetFiles();
|
||||
|
||||
void OpenDirectoryPicker(ErrorResult& aRv);
|
||||
void CancelDirectoryPickerScanIfRunning();
|
||||
|
@ -1254,7 +1254,7 @@ protected:
|
|||
*/
|
||||
nsTArray<nsRefPtr<DOMFile>> mFiles;
|
||||
|
||||
nsRefPtr<nsDOMFileList> mFileList;
|
||||
nsRefPtr<FileList> mFileList;
|
||||
|
||||
nsRefPtr<DirPickerFileListBuilderTask> mDirPickerFileListBuilderTask;
|
||||
|
||||
|
|
|
@ -406,7 +406,6 @@ DOMInterfaces = {
|
|||
},
|
||||
|
||||
'FileList': {
|
||||
'nativeType': 'mozilla::dom::nsDOMFileList',
|
||||
'headerFile': 'nsDOMFile.h',
|
||||
},
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ DataTransfer::GetMozUserCancelled(bool* aUserCancelled)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
nsDOMFileList*
|
||||
FileList*
|
||||
DataTransfer::GetFiles(ErrorResult& aRv)
|
||||
{
|
||||
if (mEventType != NS_DRAGDROP_DROP && mEventType != NS_DRAGDROP_DRAGDROP &&
|
||||
|
@ -278,7 +278,7 @@ DataTransfer::GetFiles(ErrorResult& aRv)
|
|||
}
|
||||
|
||||
if (!mFiles) {
|
||||
mFiles = new nsDOMFileList(static_cast<nsIDOMDataTransfer*>(this));
|
||||
mFiles = new FileList(static_cast<nsIDOMDataTransfer*>(this));
|
||||
|
||||
uint32_t count = mItems.Length();
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ public:
|
|||
ErrorResult& aRv);
|
||||
void ClearData(const mozilla::dom::Optional<nsAString>& aFormat,
|
||||
mozilla::ErrorResult& aRv);
|
||||
nsDOMFileList* GetFiles(mozilla::ErrorResult& aRv);
|
||||
FileList* GetFiles(mozilla::ErrorResult& aRv);
|
||||
void AddElement(Element& aElement, mozilla::ErrorResult& aRv);
|
||||
uint32_t MozItemCount()
|
||||
{
|
||||
|
@ -278,7 +278,7 @@ protected:
|
|||
nsTArray<nsTArray<TransferItem> > mItems;
|
||||
|
||||
// array of files, containing only the files present in the dataTransfer
|
||||
nsRefPtr<nsDOMFileList> mFiles;
|
||||
nsRefPtr<FileList> mFiles;
|
||||
|
||||
// the target of the drag. The drag and dragend events will fire at this.
|
||||
nsCOMPtr<mozilla::dom::Element> mDragTarget;
|
||||
|
|
Загрузка…
Ссылка в новой задаче