module.cpp revision 670515410f8bfcc1248752473f344e7bce2fb12b
/** @file
*
* XPCOM module implementation functions
*/
/*
* Copyright (C) 2006-2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
/* Make sure all the stdint.h macros are included - must come first! */
#ifndef __STDC_LIMIT_MACROS
# define __STDC_LIMIT_MACROS
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif
#include <nsIGenericFactory.h>
// generated file
#include "VirtualBox_XPCOM.h"
#include "SessionImpl.h"
#include "VirtualBoxClientImpl.h"
#include "RemoteUSBDeviceImpl.h"
#include "USBDeviceImpl.h"
#include "Logging.h"
// XPCOM glue code unfolding
#ifndef VBOX_COM_INPROC_API_CLIENT
#endif /* VBOX_COM_INPROC_API_CLIENT */
/*
* Declare extern variables here to tell the compiler that
* NS_DECL_CLASSINFO(SessionWrap)
* already exists in the VBoxAPIWrap library.
*/
/*
* Declare extern variables here to tell the compiler that
* NS_DECL_CLASSINFO(VirtualBoxClientWrap)
* already exists in the VBoxAPIWrap library.
*/
/**
* Singleton class factory that holds a reference to the created instance
* (preventing it from being destroyed) until the module is explicitly
* unloaded by the XPCOM shutdown code.
*
* Suitable for IN-PROC components.
*/
class SessionClassFactory : public Session
{
public:
virtual ~SessionClassFactory() {
FinalRelease();
instance = 0;
}
if (instance == 0) {
instance = new SessionClassFactory();
if (instance) {
else
} else {
}
} else {
}
return rv;
}
static nsresult releaseInstance () {
if (instance)
return NS_OK;
}
private:
};
/** @note this is for singleton; disabled for now */
//
//Session *SessionClassFactory::instance = 0;
//
//NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR_WITH_RC (
// Session, SessionClassFactory::getInstance
//)
/**
* Component definition table.
* Lists all components defined in this module.
*/
static const nsModuleComponentInfo components[] =
{
{
"Session component", // description
SessionConstructor, // constructor function
NULL, // registration function
NULL, // deregistration function
/** @note this is for singleton; disabled for now */
// SessionClassFactory::releaseInstance,
NULL, // destructor function
NULL, // language helper
},
{
"VirtualBoxClient component", // description
VirtualBoxClientConstructor, // constructor function
NULL, // registration function
NULL, // deregistration function
NULL, // destructor function
NULL, // language helper
},
};
/* vi: set tabstop=4 shiftwidth=4 expandtab: */