Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
* vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
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
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef nsTerminator_h__
8
#define nsTerminator_h__
9
10
#include "nsISupports.h"
11
#include "nsIObserver.h"
12
13
namespace mozilla {
14
15
class nsTerminator final : public nsIObserver {
16
public:
17
NS_DECL_ISUPPORTS
18
NS_DECL_NSIOBSERVER
19
20
nsTerminator();
21
22
private:
23
nsresult SelfInit();
24
void Start();
25
void StartWatchdog();
26
void StartWriter();
27
28
void UpdateHeartbeat(const char* aTopic);
29
void UpdateTelemetry();
30
void UpdateCrashReport(const char* aTopic);
31
32
~nsTerminator() {}
33
34
bool mInitialized;
35
int32_t mCurrentStep;
36
};
37
38
// This is called by XPCOMInit when the shutdown is completed.
39
void XPCOMShutdownNotified();
40
41
} // namespace mozilla
42
43
#define NS_TOOLKIT_TERMINATOR_CID \
44
{ \
45
0x2e59cc70, 0xf83a, 0x412f, { \
46
0x89, 0xd4, 0x45, 0x38, 0x85, 0x83, 0x72, 0x17 \
47
} \
48
}
49
#define NS_TOOLKIT_TERMINATOR_CONTRACTID \
50
"@mozilla.org/toolkit/shutdown-terminator;1"
51
52
#endif // nsTerminator_h__