bool PluginControllerProxy::tryToShortCircuitEvaluate(NPObject* npObject, const String& scriptString, NPVariant* result)
{
    // Only try to short circuit evaluate for plug-ins that have the quirk specified.
#if PLUGIN_ARCHITECTURE(MAC)
    if (!PluginProcess::shared().netscapePluginModule()->pluginQuirks().contains(PluginQuirks::CanShortCircuitSomeNPRuntimeCallsDuringInitialization))
        return false;
#else
    return false;
#endif

    // And only when we're in initialize.
    if (!inInitialize())
        return false;

    // And only when the NPObject is the window NPObject.
    if (npObject != m_windowNPObject)
        return false;

    // Now, check for the right strings.
    if (scriptString != "function __flash_getWindowLocation() { return window.location; }"
        && scriptString != "function __flash_getTopLocation() { return top.location; }")
        return false;

    VOID_TO_NPVARIANT(*result);
    return true;
}
Beispiel #2
0
//-------------------------------------------------------------------------------------		
bool ServerApp::initialize()
{
	if(!initThreadPool())
		return false;

	if(!installSignals())
		return false;
	
	if(!loadConfig())
		return false;
	
	if(!initializeBegin())
		return false;
	
	if(!inInitialize())
		return false;

	bool ret = initializeEnd();

#ifdef ENABLE_WATCHERS
	return ret && initializeWatcher();
#else
	return ret;
#endif
}
Beispiel #3
0
//-------------------------------------------------------------------------------------		
bool ServerApp::initialize()
{
	if(!initThreadPool())
		return false;

	if(!installSingnals())
		return false;
	
	if(!loadConfig())
		return false;
	
	if(!initializeBegin())
		return false;
	
	if(!inInitialize())
		return false;
	
	// 广播自己的地址给网上上的所有kbemachine
	// 并且从kbemachine获取basappmgr和cellappmgr以及dbmgr地址
	Componentbridge::getSingleton().getComponents().pHandler(this);
	this->getMainDispatcher().addFrequentTask(&Componentbridge::getSingleton());

	bool ret = initializeEnd();

#ifdef ENABLE_WATCHERS
	return ret && initializeWatcher();
#else
	return ret;
#endif
}
bool PluginControllerProxy::tryToShortCircuitInvoke(NPObject* npObject, NPIdentifier methodName, const NPVariant* arguments, uint32_t argumentCount, bool& returnValue, NPVariant& result)
{
    // Only try to short circuit evaluate for plug-ins that have the quirk specified.
#if PLUGIN_ARCHITECTURE(MAC)
    if (!PluginProcess::shared().netscapePluginModule()->pluginQuirks().contains(PluginQuirks::CanShortCircuitSomeNPRuntimeCallsDuringInitialization))
        return false;
#else
    return false;
#endif

    // And only when we're in initialize.
    if (!inInitialize())
        return false;
    
    // And only when the NPObject is the window NPObject.
    if (npObject != m_windowNPObject)
        return false;

    // And only when we don't have any arguments.
    if (argumentCount)
        return false;

    IdentifierRep* methodNameRep = static_cast<IdentifierRep*>(methodName);
    if (!methodNameRep->isString())
        return false;

    if (!strcmp(methodNameRep->string(), "__flash_getWindowLocation")) {
        result.type = NPVariantType_String;
        result.value.stringValue = createNPString(m_pluginCreationParameters->parameters.documentURL.utf8()); 
        returnValue = true;
        return true;
    }
    
    if (!strcmp(methodNameRep->string(), "__flash_getTopLocation")) {
        if (m_pluginCreationParameters->parameters.toplevelDocumentURL.isNull()) {
            // If the toplevel document is URL it means that the frame that the plug-in is in doesn't have access to the toplevel document.
            // In this case, just pass the string "[object]" to Flash.
            result.type = NPVariantType_String;
            result.value.stringValue = createNPString("[object]");
            returnValue = true;
            return true;
        }

        result.type = NPVariantType_String;
        result.value.stringValue = createNPString(m_pluginCreationParameters->parameters.toplevelDocumentURL.utf8()); 
        returnValue = true;
        return true;
    }

    return false;
}
Beispiel #5
0
int main(void)
{
    inInitialize();
    outInitialize();
    usbInitialize();
    for(;;){ 
        wdt_reset();
        usbPoll();
        getInput();
        if(usbInterruptIsReady()){
            /* called after every poll of the interrupt endpoint */
            /* This is a push to the host */
            usbSetInterrupt((void *)&reportBuffer, sizeof(reportBuffer));
        }
    }
    return 0;
}
Beispiel #6
0
//-------------------------------------------------------------------------------------		
bool ClientApp::initialize()
{
	if(!threadPool_.isInitialize())
		threadPool_.createThreadPool(1, 1, 4);
	
	if(!initializeBegin())
		return false;

	if(!installPyModules())
		return false;
	
	if(!installEntityDef())
		return false;

	if(!inInitialize())
		return false;

	return initializeEnd();
}
Beispiel #7
0
//-------------------------------------------------------------------------------------
bool ServerApp::initialize()
{
    if(!installSingnals())
        return false;

    if(!loadConfig())
        return false;

    if(!initializeBegin())
        return false;

    if(!inInitialize())
        return false;

    // 广播自己的地址给网上上的所有kbemachine
    // 并且从kbemachine获取basappmgr和cellappmgr以及dbmgr地址
    this->getMainDispatcher().addFrequentTask(&Componentbridge::getSingleton());

    return initializeEnd();
}