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 nsIOfflineStorage_h__
8 #define nsIOfflineStorage_h__
10 #include "mozilla/dom/quota/PersistenceType.h"
12 #define NS_OFFLINESTORAGE_IID \
13 {0x3ae00063, 0x6c13, 0x4afd, \
14 { 0x86, 0x7d, 0x33, 0xc2, 0x12, 0xd8, 0x97, 0x25 } }
26 class nsIOfflineStorage
: public nsISupports
29 typedef mozilla::dom::quota::Client Client
;
30 typedef mozilla::dom::quota::PersistenceType PersistenceType
;
32 NS_DECLARE_STATIC_IID_ACCESSOR(NS_OFFLINESTORAGE_IID
)
34 NS_IMETHOD_(const nsACString
&)
41 IsOwned(nsPIDOMWindow
* aOwner
) = 0;
43 NS_IMETHOD_(PersistenceType
)
46 return mPersistenceType
;
49 NS_IMETHOD_(const nsACString
&)
55 NS_IMETHOD_(const nsACString
&)
58 // Implementation of this method should close the storage (without aborting
59 // running operations nor discarding pending operations).
63 // Whether or not the storage has had Close called on it.
67 // Implementation of this method should close the storage, all running
68 // operations should be aborted and pending operations should be discarded.
74 : mPersistenceType(mozilla::dom::quota::PERSISTENCE_TYPE_INVALID
)
77 virtual ~nsIOfflineStorage()
80 PersistenceType mPersistenceType
;
84 NS_DEFINE_STATIC_IID_ACCESSOR(nsIOfflineStorage
, NS_OFFLINESTORAGE_IID
)
86 #define NS_DECL_NSIOFFLINESTORAGE \
87 NS_IMETHOD_(const nsACString&) \
90 NS_IMETHOD_(Client*) \
91 GetClient() MOZ_OVERRIDE; \
94 IsOwned(nsPIDOMWindow* aOwner) MOZ_OVERRIDE; \
96 NS_IMETHOD_(const nsACString&) \
97 Origin() MOZ_OVERRIDE; \
99 NS_IMETHOD_(nsresult) \
100 Close() MOZ_OVERRIDE; \
103 IsClosed() MOZ_OVERRIDE; \
106 Invalidate() MOZ_OVERRIDE;
108 #endif // nsIOfflineStorage_h__