gecko/dom/filehandle/FileRequest.h
Jan Varga 31546e1e24 Bug 1006485 - Part a: Rename FileHandle to MutableFile and LockedFile to FileHandle; r=bent
--HG--
rename : dom/filehandle/FileHandle.cpp => dom/filehandle/MutableFile.cpp
rename : dom/filehandle/FileHandle.h => dom/filehandle/MutableFile.h
rename : dom/filehandle/test/test_lockedfile_lifetimes.html => dom/filehandle/test/test_filehandle_lifetimes.html
rename : dom/filehandle/test/test_lockedfile_lifetimes_nested.html => dom/filehandle/test/test_filehandle_lifetimes_nested.html
rename : dom/filehandle/test/test_lockedfile_ordering.html => dom/filehandle/test/test_filehandle_ordering.html
rename : dom/filehandle/test/test_overlapping_lockedfiles.html => dom/filehandle/test/test_overlapping_filehandles.html
rename : dom/filehandle/test/test_readonly_lockedfiles.html => dom/filehandle/test/test_readonly_filehandles.html
rename : dom/indexedDB/IDBFileHandle.cpp => dom/indexedDB/IDBMutableFile.cpp
rename : dom/indexedDB/IDBFileHandle.h => dom/indexedDB/IDBMutableFile.h
rename : dom/webidl/IDBFileHandle.webidl => dom/webidl/IDBMutableFile.webidl
rename : dom/webidl/FileHandle.webidl => dom/webidl/MutableFile.webidl
2014-06-12 05:35:29 +02:00

83 lines
1.7 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=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_FileRequest_h
#define mozilla_dom_FileRequest_h
#include "DOMRequest.h"
#include "js/TypeDecls.h"
#include "mozilla/Attributes.h"
#include "nsAutoPtr.h"
#include "nsCycleCollectionParticipant.h"
class nsPIDOMWindow;
namespace mozilla {
class EventChainPreVisitor;
namespace dom {
class FileHandle;
class FileHelper;
class FileRequest : public DOMRequest
{
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileRequest, DOMRequest)
static already_AddRefed<FileRequest>
Create(nsPIDOMWindow* aOwner, FileHandle* aFileHandle,
bool aWrapAsDOMRequest);
// nsIDOMEventTarget
virtual nsresult
PreHandleEvent(EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
void
OnProgress(uint64_t aProgress, uint64_t aProgressMax)
{
FireProgressEvent(aProgress, aProgressMax);
}
nsresult
NotifyHelperCompleted(FileHelper* aFileHelper);
// nsWrapperCache
virtual JSObject*
WrapObject(JSContext* aCx) MOZ_OVERRIDE;
// WebIDL
FileHandle*
GetFileHandle() const;
FileHandle*
GetLockedFile() const
{
return GetFileHandle();
}
IMPL_EVENT_HANDLER(progress)
protected:
FileRequest(nsPIDOMWindow* aWindow);
~FileRequest();
void
FireProgressEvent(uint64_t aLoaded, uint64_t aTotal);
nsRefPtr<FileHandle> mFileHandle;
bool mWrapAsDOMRequest;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_FileRequest_h