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_filesnapshot_h__
8 #define mozilla_dom_indexeddb_filesnapshot_h__
10 #include "mozilla/Attributes.h"
11 #include "nsAutoPtr.h"
13 #include "nsCycleCollectionParticipant.h"
14 #include "nsDOMFile.h"
22 class FileImplSnapshot
: public DOMFileImplBase
25 NS_DECL_ISUPPORTS_INHERITED
27 // Create as a stored file
28 FileImplSnapshot(const nsAString
& aName
, const nsAString
& aContentType
,
29 uint64_t aLength
, nsIFile
* aFile
, IDBFileHandle
* aFileHandle
,
34 GetMozFullPathInternal(nsAString
& aFullPath
) MOZ_OVERRIDE
;
37 GetInternalStream(nsIInputStream
** aStream
) MOZ_OVERRIDE
;
40 Unlink() MOZ_OVERRIDE
;
43 Traverse(nsCycleCollectionTraversalCallback
&aCb
) MOZ_OVERRIDE
;
46 IsCCed() const MOZ_OVERRIDE
53 FileImplSnapshot(const FileImplSnapshot
* aOther
, uint64_t aStart
,
54 uint64_t aLength
, const nsAString
& aContentType
);
56 virtual ~FileImplSnapshot();
58 virtual already_AddRefed
<nsIDOMBlob
>
59 CreateSlice(uint64_t aStart
, uint64_t aLength
,
60 const nsAString
& aContentType
) MOZ_OVERRIDE
;
63 IsStoredFile() const MOZ_OVERRIDE
69 IsWholeFile() const MOZ_OVERRIDE
75 IsSnapshot() const MOZ_OVERRIDE
81 nsCOMPtr
<nsIFile
> mFile
;
82 nsRefPtr
<IDBFileHandle
> mFileHandle
;
87 } // namespace indexedDB
89 } // namespace mozilla
91 #endif // mozilla_dom_indexeddb_filesnapshot_h__