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"
17 struct CreateIfNonExistent
;
21 class SessionStorageService final
22 : public nsISessionStorageService
,
23 public PBackgroundSessionStorageServiceChild
{
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
36 static RefPtr
<SessionStorageService
> Acquire();
39 ~SessionStorageService();
41 mozilla::Result
<Ok
, nsresult
> Init();
45 // IPDL methods are only called by IPDL.
46 void ActorDestroy(ActorDestroyReason aWhy
) override
;
48 FlippedOnce
<false> mInitialized
;
49 FlippedOnce
<false> mActorDestroyed
;
53 } // namespace mozilla
55 #endif /* DOM_STORAGE_SESSIONSTORAGESERVICE_H_ */