dom/indexedDB/IDBFileHandle.h

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
michael@0 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef mozilla_dom_indexeddb_idbfilehandle_h__
michael@0 8 #define mozilla_dom_indexeddb_idbfilehandle_h__
michael@0 9
michael@0 10 #include "IndexedDatabase.h"
michael@0 11
michael@0 12 #include "mozilla/dom/file/FileHandle.h"
michael@0 13 #include "mozilla/dom/indexedDB/FileInfo.h"
michael@0 14
michael@0 15 BEGIN_INDEXEDDB_NAMESPACE
michael@0 16
michael@0 17 class IDBDatabase;
michael@0 18
michael@0 19 class IDBFileHandle : public file::FileHandle
michael@0 20 {
michael@0 21 typedef mozilla::dom::file::LockedFile LockedFile;
michael@0 22
michael@0 23 public:
michael@0 24 static already_AddRefed<IDBFileHandle>
michael@0 25 Create(IDBDatabase* aDatabase, const nsAString& aName,
michael@0 26 const nsAString& aType, already_AddRefed<FileInfo> aFileInfo);
michael@0 27
michael@0 28
michael@0 29 virtual int64_t
michael@0 30 GetFileId() MOZ_OVERRIDE
michael@0 31 {
michael@0 32 return mFileInfo->Id();
michael@0 33 }
michael@0 34
michael@0 35 virtual FileInfo*
michael@0 36 GetFileInfo() MOZ_OVERRIDE
michael@0 37 {
michael@0 38 return mFileInfo;
michael@0 39 }
michael@0 40
michael@0 41 virtual already_AddRefed<nsISupports>
michael@0 42 CreateStream(nsIFile* aFile, bool aReadOnly) MOZ_OVERRIDE;
michael@0 43
michael@0 44 virtual already_AddRefed<nsIDOMFile>
michael@0 45 CreateFileObject(LockedFile* aLockedFile, uint32_t aFileSize) MOZ_OVERRIDE;
michael@0 46
michael@0 47 // nsWrapperCache
michael@0 48 virtual JSObject*
michael@0 49 WrapObject(JSContext* aCx) MOZ_OVERRIDE;
michael@0 50
michael@0 51 // WebIDL
michael@0 52 IDBDatabase*
michael@0 53 Database();
michael@0 54
michael@0 55 private:
michael@0 56 IDBFileHandle(IDBDatabase* aOwner);
michael@0 57
michael@0 58 ~IDBFileHandle()
michael@0 59 {
michael@0 60 }
michael@0 61
michael@0 62 nsRefPtr<FileInfo> mFileInfo;
michael@0 63 };
michael@0 64
michael@0 65 END_INDEXEDDB_NAMESPACE
michael@0 66
michael@0 67 #endif // mozilla_dom_indexeddb_idbfilehandle_h__

mercurial