2012-06-03 09:33:52 -07:00
|
|
|
/* -*- 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_file_filerequest_h__
|
|
|
|
#define mozilla_dom_file_filerequest_h__
|
|
|
|
|
2013-06-05 09:15:48 -07:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-06-03 09:33:52 -07:00
|
|
|
#include "FileCommon.h"
|
|
|
|
|
|
|
|
#include "DOMRequest.h"
|
|
|
|
|
|
|
|
BEGIN_FILE_NAMESPACE
|
|
|
|
|
|
|
|
class FileHelper;
|
|
|
|
class LockedFile;
|
|
|
|
|
2013-03-17 01:51:36 -07:00
|
|
|
class FileRequest : public mozilla::dom::DOMRequest
|
2012-06-03 09:33:52 -07:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(FileRequest, DOMRequest)
|
|
|
|
|
|
|
|
static already_AddRefed<FileRequest>
|
2014-02-09 00:04:37 -08:00
|
|
|
Create(nsPIDOMWindow* aOwner, LockedFile* aLockedFile);
|
2012-06-03 09:33:52 -07:00
|
|
|
|
|
|
|
// nsIDOMEventTarget
|
|
|
|
virtual nsresult
|
2013-06-05 09:15:48 -07:00
|
|
|
PreHandleEvent(nsEventChainPreVisitor& aVisitor) MOZ_OVERRIDE;
|
2012-06-03 09:33:52 -07:00
|
|
|
|
|
|
|
void
|
2012-08-22 08:56:38 -07:00
|
|
|
OnProgress(uint64_t aProgress, uint64_t aProgressMax)
|
2012-06-03 09:33:52 -07:00
|
|
|
{
|
|
|
|
FireProgressEvent(aProgress, aProgressMax);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
|
|
|
NotifyHelperCompleted(FileHelper* aFileHelper);
|
|
|
|
|
2013-03-17 01:51:36 -07:00
|
|
|
protected:
|
2014-01-06 18:53:23 -08:00
|
|
|
FileRequest(nsPIDOMWindow* aWindow);
|
2012-06-03 09:33:52 -07:00
|
|
|
~FileRequest();
|
|
|
|
|
|
|
|
void
|
2012-08-22 08:56:38 -07:00
|
|
|
FireProgressEvent(uint64_t aLoaded, uint64_t aTotal);
|
2012-06-03 09:33:52 -07:00
|
|
|
|
|
|
|
nsRefPtr<LockedFile> mLockedFile;
|
|
|
|
};
|
|
|
|
|
|
|
|
END_FILE_NAMESPACE
|
|
|
|
|
|
|
|
#endif // mozilla_dom_file_filerequest_h__
|