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