Source code

Revision control

Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#ifndef mozilla_dom_SessionStorageService_h
6
#define mozilla_dom_SessionStorageService_h
7
8
#include "mozilla/UniquePtr.h"
9
#include "nsIObserver.h"
10
#include "nsISupportsImpl.h"
11
#include "nsPointerHashKeys.h"
12
#include "nsTHashtable.h"
13
14
namespace mozilla {
15
namespace dom {
16
17
class SessionStorageManager;
18
19
class SessionStorageService final : public nsIObserver {
20
public:
21
SessionStorageService();
22
23
static SessionStorageService* Get();
24
25
NS_DECL_ISUPPORTS
26
NS_DECL_NSIOBSERVER
27
28
void RegisterSessionStorageManager(SessionStorageManager* aManager);
29
void UnregisterSessionStorageManager(SessionStorageManager* aManager);
30
31
private:
32
~SessionStorageService();
33
34
static void ShutDown();
35
36
void SendSessionStorageDataToParentProcess();
37
38
static RefPtr<SessionStorageService> sService;
39
static bool sShutdown;
40
41
nsTHashtable<nsPtrHashKey<SessionStorageManager>> mManagers;
42
};
43
44
} // namespace dom
45
} // namespace mozilla
46
47
#endif // mozilla_dom_SessionStorageService_h