1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/system/OSFileConstants.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,58 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this file, 1.6 + * You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef mozilla_osfileconstants_h__ 1.9 +#define mozilla_osfileconstants_h__ 1.10 + 1.11 +#include "nsIOSFileConstantsService.h" 1.12 +#include "mozilla/Attributes.h" 1.13 + 1.14 +namespace mozilla { 1.15 + 1.16 +/** 1.17 + * Perform initialization of this module. 1.18 + * 1.19 + * This function _must_ be called: 1.20 + * - from the main thread; 1.21 + * - before any Chrome Worker is created. 1.22 + * 1.23 + * The function is idempotent. 1.24 + */ 1.25 +nsresult InitOSFileConstants(); 1.26 + 1.27 +/** 1.28 + * Perform cleanup of this module. 1.29 + * 1.30 + * This function _must_ be called: 1.31 + * - from the main thread; 1.32 + * - after all Chrome Workers are dead. 1.33 + * 1.34 + * The function is idempotent. 1.35 + */ 1.36 +void CleanupOSFileConstants(); 1.37 + 1.38 +/** 1.39 + * Define OS-specific constants. 1.40 + * 1.41 + * This function creates or uses JS object |OS.Constants| to store 1.42 + * all its constants. 1.43 + */ 1.44 +bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global); 1.45 + 1.46 +/** 1.47 + * XPConnect initializer, for use in the main thread. 1.48 + */ 1.49 +class OSFileConstantsService MOZ_FINAL : public nsIOSFileConstantsService 1.50 +{ 1.51 + public: 1.52 + NS_DECL_ISUPPORTS 1.53 + NS_DECL_NSIOSFILECONSTANTSSERVICE 1.54 + OSFileConstantsService(); 1.55 +private: 1.56 + ~OSFileConstantsService(); 1.57 +}; 1.58 + 1.59 +} 1.60 + 1.61 +#endif // mozilla_osfileconstants_h__