module.cpp revision 16223988a6f272e21cd0c79d89ab6d3b8d767028
/** @file
*
* XPCOM module implementation functions
*/
/*
* Copyright (C) 2006-2007 Sun Microsystems, Inc.
*
* 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.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
/* 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 "GuestImpl.h"
#include "KeyboardImpl.h"
#include "MouseImpl.h"
#include "DisplayImpl.h"
#include "MachineDebuggerImpl.h"
#include "USBDeviceImpl.h"
#include "RemoteUSBDeviceImpl.h"
#include "SharedFolderImpl.h"
#include "FramebufferImpl.h"
#include "ProgressImpl.h"
#include "NetworkAdapterImpl.h"
#include "SessionImpl.h"
#include "ConsoleImpl.h"
#include "ConsoleVRDPServer.h"
#include "Logging.h"
// XPCOM glue code unfolding
COM_IMPL_READONLY_ENUM_AND_COLLECTION_EX(ComObjPtr <RemoteUSBDevice>, IHostUSBDevice, RemoteUSBDevice)
/**
* 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
}
};