michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_osfileconstants_h__ michael@0: #define mozilla_osfileconstants_h__ michael@0: michael@0: #include "nsIOSFileConstantsService.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: /** michael@0: * Perform initialization of this module. michael@0: * michael@0: * This function _must_ be called: michael@0: * - from the main thread; michael@0: * - before any Chrome Worker is created. michael@0: * michael@0: * The function is idempotent. michael@0: */ michael@0: nsresult InitOSFileConstants(); michael@0: michael@0: /** michael@0: * Perform cleanup of this module. michael@0: * michael@0: * This function _must_ be called: michael@0: * - from the main thread; michael@0: * - after all Chrome Workers are dead. michael@0: * michael@0: * The function is idempotent. michael@0: */ michael@0: void CleanupOSFileConstants(); michael@0: michael@0: /** michael@0: * Define OS-specific constants. michael@0: * michael@0: * This function creates or uses JS object |OS.Constants| to store michael@0: * all its constants. michael@0: */ michael@0: bool DefineOSFileConstants(JSContext *cx, JS::Handle global); michael@0: michael@0: /** michael@0: * XPConnect initializer, for use in the main thread. michael@0: */ michael@0: class OSFileConstantsService MOZ_FINAL : public nsIOSFileConstantsService michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIOSFILECONSTANTSSERVICE michael@0: OSFileConstantsService(); michael@0: private: michael@0: ~OSFileConstantsService(); michael@0: }; michael@0: michael@0: } michael@0: michael@0: #endif // mozilla_osfileconstants_h__