Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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/. */
5 #ifndef mozilla_osfileconstants_h__
6 #define mozilla_osfileconstants_h__
8 #include "nsIOSFileConstantsService.h"
9 #include "mozilla/Attributes.h"
11 namespace mozilla {
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();
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();
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);
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 };
56 }
58 #endif // mozilla_osfileconstants_h__