Bug 1852740: add tests for the `fetchpriority` attribute in Link headers. r=necko...
[gecko.git] / dom / storage / SessionStorageService.h
blob70b780a0ee36eda7b93a1a55e22fe42fb4621f67
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=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 DOM_STORAGE_SESSIONSTORAGESERVICE_H_
8 #define DOM_STORAGE_SESSIONSTORAGESERVICE_H_
10 #include "nsISessionStorageService.h"
11 #include "mozilla/Result.h"
12 #include "mozilla/dom/FlippedOnce.h"
13 #include "mozilla/dom/PBackgroundSessionStorageServiceChild.h"
15 namespace mozilla {
17 struct CreateIfNonExistent;
19 namespace dom {
21 class SessionStorageService final
22 : public nsISessionStorageService,
23 public PBackgroundSessionStorageServiceChild {
24 public:
25 NS_DECL_ISUPPORTS
26 NS_DECL_NSISESSIONSTORAGESERVICE
28 SessionStorageService();
30 // Singleton Boilerplate
31 static mozilla::Result<RefPtr<SessionStorageService>, nsresult> Acquire(
32 const CreateIfNonExistent&);
34 // Can return null if the service hasn't be created yet or after
35 // XPCOMShutdown.
36 static RefPtr<SessionStorageService> Acquire();
38 private:
39 ~SessionStorageService();
41 mozilla::Result<Ok, nsresult> Init();
43 void Shutdown();
45 // IPDL methods are only called by IPDL.
46 void ActorDestroy(ActorDestroyReason aWhy) override;
48 FlippedOnce<false> mInitialized;
49 FlippedOnce<false> mActorDestroyed;
52 } // namespace dom
53 } // namespace mozilla
55 #endif /* DOM_STORAGE_SESSIONSTORAGESERVICE_H_ */