2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-09 14:00:48 +04: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 16:30:58 +04:00
|
|
|
#include "nsIOSFileConstantsService.h"
|
2012-07-11 08:14:37 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2012-05-09 14:00:48 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2012-06-29 05:56:30 +04:00
|
|
|
/**
|
|
|
|
* Perform initialization of this module.
|
|
|
|
*
|
|
|
|
* This function _must_ be called:
|
|
|
|
* - from the main thread;
|
|
|
|
* - before any Chrome Worker is created.
|
2012-07-04 16:30:58 +04:00
|
|
|
*
|
|
|
|
* The function is idempotent.
|
2012-06-29 05:56:30 +04: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 16:30:58 +04:00
|
|
|
*
|
|
|
|
* The function is idempotent.
|
2012-06-29 05:56:30 +04:00
|
|
|
*/
|
2012-07-04 16:30:58 +04:00
|
|
|
void CleanupOSFileConstants();
|
2012-06-29 05:56:30 +04:00
|
|
|
|
2012-05-09 14:00:48 +04:00
|
|
|
/**
|
|
|
|
* Define OS-specific constants.
|
|
|
|
*
|
|
|
|
* This function creates or uses JS object |OS.Constants| to store
|
|
|
|
* all its constants.
|
|
|
|
*/
|
2013-05-11 06:39:45 +04:00
|
|
|
bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global);
|
2012-05-09 14:00:48 +04:00
|
|
|
|
2012-07-04 16:30:58 +04:00
|
|
|
/**
|
|
|
|
* XPConnect initializer, for use in the main thread.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
class OSFileConstantsService final : public nsIOSFileConstantsService
|
2012-07-04 16:30:58 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOSFILECONSTANTSSERVICE
|
|
|
|
OSFileConstantsService();
|
|
|
|
private:
|
|
|
|
~OSFileConstantsService();
|
|
|
|
};
|
|
|
|
|
2012-05-09 14:00:48 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // mozilla_osfileconstants_h__
|