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_idbfilehandle_h__
8 #define mozilla_dom_indexeddb_idbfilehandle_h__
10 #include "IndexedDatabase.h"
12 #include "nsIIDBFileHandle.h"
14 #include "mozilla/dom/file/FileHandle.h"
15 #include "mozilla/dom/indexedDB/FileInfo.h"
17 BEGIN_INDEXEDDB_NAMESPACE
19 class IDBFileHandle
: public mozilla::dom::file::FileHandle
,
20 public nsIIDBFileHandle
23 NS_DECL_ISUPPORTS_INHERITED
24 NS_DECL_NSIIDBFILEHANDLE
29 return mFileInfo
->Id();
32 NS_IMETHOD_(FileInfo
*)
38 static already_AddRefed
<IDBFileHandle
>
39 Create(IDBDatabase
* aDatabase
, const nsAString
& aName
,
40 const nsAString
& aType
, already_AddRefed
<FileInfo
> aFileInfo
);
42 virtual already_AddRefed
<nsISupports
>
43 CreateStream(nsIFile
* aFile
, bool aReadOnly
);
45 virtual already_AddRefed
<nsIDOMFile
>
46 CreateFileObject(mozilla::dom::file::LockedFile
* aLockedFile
,
56 nsRefPtr
<FileInfo
> mFileInfo
;
59 END_INDEXEDDB_NAMESPACE
61 #endif // mozilla_dom_indexeddb_idbfilehandle_h__