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