1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_indexeddb_idbfilerequest_h__
8 #define mozilla_dom_indexeddb_idbfilerequest_h__
10 #include "DOMRequest.h"
11 #include "js/TypeDecls.h"
12 #include "mozilla/Attributes.h"
13 #include "mozilla/dom/FileRequest.h"
14 #include "nsAutoPtr.h"
15 #include "nsCycleCollectionParticipant.h"
21 class EventChainPreVisitor
;
28 class IDBFileRequest MOZ_FINAL
: public DOMRequest
,
29 public FileRequestBase
32 NS_DECL_ISUPPORTS_INHERITED
34 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IDBFileRequest
, DOMRequest
)
36 static already_AddRefed
<IDBFileRequest
>
37 Create(nsPIDOMWindow
* aOwner
, IDBFileHandle
* aFileHandle
,
38 bool aWrapAsDOMRequest
);
42 PreHandleEvent(EventChainPreVisitor
& aVisitor
) MOZ_OVERRIDE
;
46 OnProgress(uint64_t aProgress
, uint64_t aProgressMax
) MOZ_OVERRIDE
;
49 NotifyHelperCompleted(FileHelper
* aFileHelper
) MOZ_OVERRIDE
;
53 WrapObject(JSContext
* aCx
) MOZ_OVERRIDE
;
57 GetFileHandle() const;
62 return GetFileHandle();
65 IMPL_EVENT_HANDLER(progress
)
68 IDBFileRequest(nsPIDOMWindow
* aWindow
);
72 FireProgressEvent(uint64_t aLoaded
, uint64_t aTotal
);
74 nsRefPtr
<IDBFileHandle
> mFileHandle
;
76 bool mWrapAsDOMRequest
;
79 } // namespace indexedDB
81 } // namespace mozilla
83 #endif // mozilla_dom_indexeddb_idbfilerequest_h__