Bumping manifests a=b2g-bump
[gecko.git] / dom / quota / nsIOfflineStorage.h
blobeee167749a21019846fecd44baafe0f55a2ec143
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 } }
16 class nsPIDOMWindow;
18 namespace mozilla {
19 namespace dom {
20 namespace quota {
21 class Client;
26 class nsIOfflineStorage : public nsISupports
28 public:
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&)
35 Id() = 0;
37 NS_IMETHOD_(Client*)
38 GetClient() = 0;
40 NS_IMETHOD_(bool)
41 IsOwned(nsPIDOMWindow* aOwner) = 0;
43 NS_IMETHOD_(PersistenceType)
44 Type()
46 return mPersistenceType;
49 NS_IMETHOD_(const nsACString&)
50 Group()
52 return mGroup;
55 NS_IMETHOD_(const nsACString&)
56 Origin() = 0;
58 // Implementation of this method should close the storage (without aborting
59 // running operations nor discarding pending operations).
60 NS_IMETHOD_(nsresult)
61 Close() = 0;
63 // Whether or not the storage has had Close called on it.
64 NS_IMETHOD_(bool)
65 IsClosed() = 0;
67 // Implementation of this method should close the storage, all running
68 // operations should be aborted and pending operations should be discarded.
69 NS_IMETHOD_(void)
70 Invalidate() = 0;
72 protected:
73 nsIOfflineStorage()
74 : mPersistenceType(mozilla::dom::quota::PERSISTENCE_TYPE_INVALID)
75 { }
77 virtual ~nsIOfflineStorage()
78 { }
80 PersistenceType mPersistenceType;
81 nsCString mGroup;
84 NS_DEFINE_STATIC_IID_ACCESSOR(nsIOfflineStorage, NS_OFFLINESTORAGE_IID)
86 #define NS_DECL_NSIOFFLINESTORAGE \
87 NS_IMETHOD_(const nsACString&) \
88 Id() MOZ_OVERRIDE; \
90 NS_IMETHOD_(Client*) \
91 GetClient() MOZ_OVERRIDE; \
93 NS_IMETHOD_(bool) \
94 IsOwned(nsPIDOMWindow* aOwner) MOZ_OVERRIDE; \
96 NS_IMETHOD_(const nsACString&) \
97 Origin() MOZ_OVERRIDE; \
99 NS_IMETHOD_(nsresult) \
100 Close() MOZ_OVERRIDE; \
102 NS_IMETHOD_(bool) \
103 IsClosed() MOZ_OVERRIDE; \
105 NS_IMETHOD_(void) \
106 Invalidate() MOZ_OVERRIDE;
108 #endif // nsIOfflineStorage_h__