dom/system/OSFileConstants.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:b970e18279d1
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 file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #ifndef mozilla_osfileconstants_h__
6 #define mozilla_osfileconstants_h__
7
8 #include "nsIOSFileConstantsService.h"
9 #include "mozilla/Attributes.h"
10
11 namespace mozilla {
12
13 /**
14 * Perform initialization of this module.
15 *
16 * This function _must_ be called:
17 * - from the main thread;
18 * - before any Chrome Worker is created.
19 *
20 * The function is idempotent.
21 */
22 nsresult InitOSFileConstants();
23
24 /**
25 * Perform cleanup of this module.
26 *
27 * This function _must_ be called:
28 * - from the main thread;
29 * - after all Chrome Workers are dead.
30 *
31 * The function is idempotent.
32 */
33 void CleanupOSFileConstants();
34
35 /**
36 * Define OS-specific constants.
37 *
38 * This function creates or uses JS object |OS.Constants| to store
39 * all its constants.
40 */
41 bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global);
42
43 /**
44 * XPConnect initializer, for use in the main thread.
45 */
46 class OSFileConstantsService MOZ_FINAL : public nsIOSFileConstantsService
47 {
48 public:
49 NS_DECL_ISUPPORTS
50 NS_DECL_NSIOSFILECONSTANTSSERVICE
51 OSFileConstantsService();
52 private:
53 ~OSFileConstantsService();
54 };
55
56 }
57
58 #endif // mozilla_osfileconstants_h__

mercurial