Ejemplo n.º 1
0
CPluginInstancePeer::CPluginInstancePeer(NPP npp,
                                         nsMIMEType typeString, 
                                         nsPluginMode type,
                                         PRUint16 attr_cnt, 
                                         const char** attr_list, 
                                         const char** val_list)
    : npp(npp), typeString(typeString), type(type), attribute_cnt((PRUint16)NULL),
    attribute_list(NULL), values_list(NULL)
{
    // Set the reference count to 0.
    NS_INIT_REFCNT();

	attribute_list = (char**) NPN_MemAlloc(attr_cnt * sizeof(const char*));
	values_list = (char**) NPN_MemAlloc(attr_cnt * sizeof(const char*));

	if (attribute_list != NULL && values_list != NULL) {
		for (int i = 0, j = 0; i < attr_cnt; i++)   {
            if (attr_list[i] != NULL && val_list[i] != NULL) {           
                
                attribute_list[j] = (char*) NPN_MemAlloc(strlen(attr_list[i]) + 1);
                if (attribute_list[j] != NULL)
                    strcpy(attribute_list[j], attr_list[i]);

                values_list[j] = (char*) NPN_MemAlloc(strlen(val_list[i]) + 1);
                if (values_list[j] != NULL)
                    strcpy(values_list[j], val_list[i]);

                j = j + 1;
                attribute_cnt = j;
            }
		}
	}
}
Ejemplo n.º 2
0
CPluginStreamPeer::CPluginStreamPeer(nsMIMEType type, NPStream* npStream,
									 PRUint16* stype)
	: type(type), npStream(npStream),
	  stype(stype), reason(nsPluginReason_NoReason)
{
    // Set the reference count to 0.
    NS_INIT_REFCNT();
}
CNSAdapter_SecureJNIEnv::CNSAdapter_SecureJNIEnv(ISecureEnv* pSecureEnv)
{
    NS_INIT_REFCNT();
    m_pSecureEnv = pSecureEnv;
    
    if (m_pSecureEnv != NULL)
	m_pSecureEnv->AddRef();
}
//=--------------------------------------------------------------------------=
// CNSAdapter_SecurityContext::CNSAdapter_SecurityContext
//=--------------------------------------------------------------------------=
//
// notes :
//	
CNSAdapter_SecurityContext::CNSAdapter_SecurityContext(ISecurityContext* pSecurityContext) : 
m_pSecurityContext(pSecurityContext) 
{
    TRACE("CNSAdapter_SecurityContext::CNSAdapter_SecurityContext\n");

    NS_INIT_REFCNT();	
    if (m_pSecurityContext)
	m_pSecurityContext->AddRef();
}
//=--------------------------------------------------------------------------=
// CNSAdapter_JavaPlugin::CNSAdapter_JavaPlugin
//=--------------------------------------------------------------------------=
//
// notes :
//
CNSAdapter_JavaPlugin::CNSAdapter_JavaPlugin(IPluginInstance* pJavaPlugin) : 
  m_pJavaPlugin(pJavaPlugin), m_peer(NULL)
{
    TRACE("CNSAdapter_JavaPlugin::CNSAdapter_JavaPlugin\n");

    NS_INIT_REFCNT();

    if (m_pJavaPlugin)
	m_pJavaPlugin->AddRef();
}
Ejemplo n.º 6
0
MTStartImpl::MTStartImpl()
{    
    NS_INIT_REFCNT();
    printf("MTStartImpl::MTStartImp\n");
    nsresult rv = nsComponentManager::CreateInstance(MTHREADCONTEXT_PROGID,
                                            nsnull,
                                            NS_GET_IID(iMThreadContext),
                                            (void**)&context); 
    if(NS_FAILED(rv)) {
        fprintf(stderr, "Create instance of context failed!!!");
        return;
    }
    char* first=(char*)PR_Malloc(sizeof(char*));

    
    context->GetContractID(0,1,&first);
    nsCID firstCID;
    firstCID.Parse(first);
    iMThreadComponent* tComponent=NULL;
    rv = nsComponentManager::CreateInstance(firstCID,
                                            nsnull,
                                            NS_GET_IID(iMThreadComponent),
                                            (void**)&tComponent);   
    if(NS_FAILED(rv)) {
        fprintf(stderr, "Create instance failed from %s!!!",first);
        return;
    }

    eThread = PR_GetCurrentThread();

        char* res=(char*)PR_Malloc(sizeof(char*));
	context->GetResFile(&res);

	if ((file = fopen(res, "w+t")) == NULL) {
		fprintf(stderr, "ERROR: can't open file %s\n",res);
	}
	char* tmp="0,0,";
	fwrite(tmp,1,PL_strlen(tmp),file);
	sprintf(tmp,"%d\n",eThread);
	fwrite(tmp,1,PL_strlen(tmp),file);
	fclose(file);

    tComponent->Initialize(context);
    nsIComponentManager* cm;
    rv = NS_GetGlobalComponentManager(&cm);
    if(NS_FAILED(rv)) {
        fprintf(stderr, "ERROR: Can't get GlobalComponentManager!!\n");
    }
    tComponent->THack(cm);
    tComponent->Execute(0,1);
}
Ejemplo n.º 7
0
//=--------------------------------------------------------------------------=
// CNS7Adapter_Observer::CNS7Adapter_Observer
//=--------------------------------------------------------------------------=
// params:  pIObserver: reference to plug-in side's observer implementation
//
// notes :
//
CNS7Adapter_Observer::CNS7Adapter_Observer(IObserver* pIObserver) : m_pIObserver(pIObserver)
{
    NS_INIT_REFCNT();
    if (m_pIObserver)
        m_pIObserver->AddRef();
}
Ejemplo n.º 8
0
CPluginManager::CPluginManager(void) 
{
    // Set reference count to 0.
    NS_INIT_REFCNT();
}
Ejemplo n.º 9
0
CPluginManagerStream::CPluginManagerStream(NPP npp, NPStream* pstr)
    : npp(npp), pstream(pstr)
{
    // Set the reference count to 0.
    NS_INIT_REFCNT();
}
Ejemplo n.º 10
0
bcXPCOMWrappers::bcXPCOMWrappers() {
    NS_INIT_REFCNT();
}
Ejemplo n.º 11
0
urpConnectComponent::urpConnectComponent() :
    transport(0), connection(0), compM(0), man(0), stub(0), orb(0)
{
    NS_INIT_REFCNT();
}
nsProgressManager::nsProgressManager(MWContext* context)
    : fContext(context)
{
    NS_INIT_REFCNT();
}