2012-05-09 10:00:48 +00: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__
|
|
|
|
|
|
|
|
#include "jspubtd.h"
|
2012-07-04 12:30:58 +00:00
|
|
|
#include "nsIOSFileConstantsService.h"
|
2012-07-11 04:14:37 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-05-09 10:00:48 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2012-06-29 01:56:30 +00:00
|
|
|
/**
|
|
|
|
* Perform initialization of this module.
|
|
|
|
*
|
|
|
|
* This function _must_ be called:
|
|
|
|
* - from the main thread;
|
|
|
|
* - before any Chrome Worker is created.
|
2012-07-04 12:30:58 +00:00
|
|
|
*
|
|
|
|
* The function is idempotent.
|
2012-06-29 01:56:30 +00: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 12:30:58 +00:00
|
|
|
*
|
|
|
|
* The function is idempotent.
|
2012-06-29 01:56:30 +00:00
|
|
|
*/
|
2012-07-04 12:30:58 +00:00
|
|
|
void CleanupOSFileConstants();
|
2012-06-29 01:56:30 +00:00
|
|
|
|
2012-05-09 10:00:48 +00:00
|
|
|
/**
|
|
|
|
* Define OS-specific constants.
|
|
|
|
*
|
|
|
|
* This function creates or uses JS object |OS.Constants| to store
|
|
|
|
* all its constants.
|
|
|
|
*/
|
2013-05-11 02:39:45 +00:00
|
|
|
bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global);
|
2012-05-09 10:00:48 +00:00
|
|
|
|
2012-07-04 12:30:58 +00:00
|
|
|
/**
|
|
|
|
* XPConnect initializer, for use in the main thread.
|
|
|
|
*/
|
2012-07-11 04:14:37 +00:00
|
|
|
class OSFileConstantsService MOZ_FINAL : public nsIOSFileConstantsService
|
2012-07-04 12:30:58 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOSFILECONSTANTSSERVICE
|
|
|
|
OSFileConstantsService();
|
|
|
|
private:
|
|
|
|
~OSFileConstantsService();
|
|
|
|
};
|
|
|
|
|
2012-05-09 10:00:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // mozilla_osfileconstants_h__
|