本文整理汇总了C++中PluginControllerProxy类的典型用法代码示例。如果您正苦于以下问题:C++ PluginControllerProxy类的具体用法?C++ PluginControllerProxy怎么用?C++ PluginControllerProxy使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginControllerProxy类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: activityAssertion
void WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageDecoder& decoder, std::unique_ptr<CoreIPC::MessageEncoder>& replyEncoder)
{
// Force all timers to run at full speed when processing a synchronous message
ActivityAssertion activityAssertion(PluginProcess::shared());
ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), connection);
uint64_t destinationID = decoder.destinationID();
if (!destinationID) {
didReceiveSyncWebProcessConnectionMessage(connection, decoder, replyEncoder);
return;
}
if (decoder.messageReceiverName() == Messages::NPObjectMessageReceiver::messageReceiverName()) {
m_npRemoteObjectMap->didReceiveSyncMessage(connection, decoder, replyEncoder);
return;
}
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, decoder, replyEncoder);
}
示例2: ASSERT_NOT_REACHED
void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
if (!arguments->destinationID()) {
ASSERT_NOT_REACHED();
return;
}
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, arguments);
}
示例3: addPluginControllerProxy
void WebProcessConnection::createPlugin(uint64_t pluginInstanceID, const Plugin::Parameters& parameters, const String& userAgent, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled, bool& result, uint32_t& remoteLayerClientID)
{
OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, pluginInstanceID, userAgent, isPrivateBrowsingEnabled, isAcceleratedCompositingEnabled);
PluginControllerProxy* pluginControllerProxyPtr = pluginControllerProxy.get();
// Make sure to add the proxy to the map before initializing it, since the plug-in might call out to the web process from
// its NPP_New function. This will hand over ownership of the proxy to the web process connection.
addPluginControllerProxy(pluginControllerProxy.release());
// Now try to initialize the plug-in.
result = pluginControllerProxyPtr->initialize(parameters);
if (!result)
return;
remoteLayerClientID = pluginControllerProxyPtr->remoteLayerClientID();
}
示例4: didReceiveSyncWebProcessConnectionMessage
CoreIPC::SyncReplyMode WebProcessConnection::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
{
uint64_t destinationID = arguments->destinationID();
if (!destinationID)
return didReceiveSyncWebProcessConnectionMessage(connection, messageID, arguments, reply);
if (messageID.is<CoreIPC::MessageClassNPObjectMessageReceiver>())
return m_npRemoteObjectMap->didReceiveSyncMessage(connection, messageID, arguments, reply);
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
if (!pluginControllerProxy)
return CoreIPC::AutomaticReply;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
CoreIPC::SyncReplyMode replyMode = pluginControllerProxy->didReceiveSyncPluginControllerProxyMessage(connection, messageID, arguments, reply);
return replyMode;
}
示例5: sleep
void WebProcessConnection::createPluginAsynchronously(const PluginCreationParameters& creationParameters)
{
// In the time since this plugin was requested asynchronously we might have created it synchronously or destroyed it.
// In either of those cases we need to ignore this creation request.
if (m_asynchronousInstanceIDsToIgnore.contains(creationParameters.pluginInstanceID)) {
m_asynchronousInstanceIDsToIgnore.remove(creationParameters.pluginInstanceID);
return;
}
// This version of CreatePlugin is only used by plug-ins that are known to behave when started asynchronously.
bool result = false;
bool wantsWheelEvents = false;
uint32_t remoteLayerClientID = 0;
if (creationParameters.artificialPluginInitializationDelayEnabled) {
unsigned artificialPluginInitializationDelay = 5;
sleep(artificialPluginInitializationDelay);
}
// Since plug-in creation can often message to the WebProcess synchronously (with NPP_Evaluate for example)
// we need to make sure that the web process will handle the plug-in process's synchronous messages,
// even if the web process is waiting on a synchronous reply itself.
// Normally the plug-in process doesn't give its synchronous messages the special flag to allow for that.
// We can force it to do so by incrementing the "DispatchMessageMarkedDispatchWhenWaitingForSyncReply" count.
m_connection->incrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount();
// The call to createPluginInternal can potentially cause the plug-in to be destroyed and
// thus free the WebProcessConnection object. Protect it.
Ref<WebProcessConnection> protect(*this);
createPluginInternal(creationParameters, result, wantsWheelEvents, remoteLayerClientID);
if (!m_connection) {
// createPluginInternal caused the connection to go away.
return;
}
m_connection->decrementDispatchMessageMarkedDispatchWhenWaitingForSyncReplyCount();
// If someone asked for this plug-in synchronously while it was in the middle of being created then we need perform the
// synchronous reply instead of sending the asynchronous reply.
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(creationParameters.pluginInstanceID);
ASSERT(pluginControllerProxy);
if (RefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> delayedSyncReply = pluginControllerProxy->takeInitializationReply()) {
delayedSyncReply->send(result, wantsWheelEvents, remoteLayerClientID);
return;
}
// Otherwise, send the asynchronous results now.
if (!result) {
m_connection->sendSync(Messages::PluginProxy::DidFailToCreatePlugin(), Messages::PluginProxy::DidFailToCreatePlugin::Reply(), creationParameters.pluginInstanceID);
return;
}
m_connection->sendSync(Messages::PluginProxy::DidCreatePlugin(wantsWheelEvents, remoteLayerClientID), Messages::PluginProxy::DidCreatePlugin::Reply(), creationParameters.pluginInstanceID);
}
示例6: currentConnection
void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
{
ConnectionStack::CurrentConnectionPusher currentConnection(connectionStack(), connection);
if (messageID.is<CoreIPC::MessageClassWebProcessConnection>()) {
didReceiveWebProcessConnectionMessage(connection, messageID, arguments);
return;
}
if (!arguments->destinationID()) {
ASSERT_NOT_REACHED();
return;
}
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(arguments->destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, messageID, arguments);
}
示例7: currentConnection
void WebProcessConnection::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageDecoder& decoder)
{
ConnectionStack::CurrentConnectionPusher currentConnection(ConnectionStack::shared(), connection);
if (decoder.messageReceiverName() == Messages::WebProcessConnection::messageReceiverName()) {
didReceiveWebProcessConnectionMessage(connection, decoder);
return;
}
if (!decoder.destinationID()) {
ASSERT_NOT_REACHED();
return;
}
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, decoder);
}
示例8: currentConnectionChange
void WebProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder)
{
TemporaryChange<IPC::Connection*> currentConnectionChange(currentConnection, &connection);
if (decoder.messageReceiverName() == Messages::WebProcessConnection::messageReceiverName()) {
didReceiveWebProcessConnectionMessage(connection, decoder);
return;
}
if (!decoder.destinationID()) {
ASSERT_NOT_REACHED();
return;
}
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(decoder.destinationID());
if (!pluginControllerProxy)
return;
PluginController::PluginDestructionProtector protector(pluginControllerProxy->asPluginController());
pluginControllerProxy->didReceivePluginControllerProxyMessage(connection, decoder);
}
示例9: createPlugin
void WebProcessConnection::createPlugin(const PluginCreationParameters& creationParameters, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply> reply)
{
PluginControllerProxy* pluginControllerProxy = m_pluginControllers.get(creationParameters.pluginInstanceID);
// The controller proxy for the plug-in we're being asked to create synchronously might already exist if it was requested asynchronously before.
if (pluginControllerProxy) {
// It might still be in the middle of initialization in which case we have to let that initialization complete and respond to this message later.
if (pluginControllerProxy->isInitializing()) {
pluginControllerProxy->setInitializationReply(reply);
return;
}
// If its initialization is complete then we need to respond to this message with the correct information about its creation.
#if PLATFORM(MAC)
reply->send(true, pluginControllerProxy->wantsWheelEvents(), pluginControllerProxy->remoteLayerClientID());
#else
reply->send(true, pluginControllerProxy->wantsWheelEvents(), 0);
#endif
return;
}
// The plugin we're supposed to create might have been requested asynchronously before.
// In that case we need to create it synchronously now but flag the instance ID so we don't recreate it asynchronously later.
if (creationParameters.asynchronousCreationIncomplete)
m_asynchronousInstanceIDsToIgnore.add(creationParameters.pluginInstanceID);
bool result = false;
bool wantsWheelEvents = false;
uint32_t remoteLayerClientID = 0;
createPluginInternal(creationParameters, result, wantsWheelEvents, remoteLayerClientID);
reply->send(result, wantsWheelEvents, remoteLayerClientID);
}
示例10: addPluginControllerProxy
void WebProcessConnection::createPluginInternal(const PluginCreationParameters& creationParameters, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID)
{
OwnPtr<PluginControllerProxy> pluginControllerProxy = PluginControllerProxy::create(this, creationParameters);
PluginControllerProxy* pluginControllerProxyPtr = pluginControllerProxy.get();
// Make sure to add the proxy to the map before initializing it, since the plug-in might call out to the web process from
// its NPP_New function. This will hand over ownership of the proxy to the web process connection.
addPluginControllerProxy(pluginControllerProxy.release());
// Now try to initialize the plug-in.
result = pluginControllerProxyPtr->initialize(creationParameters);
if (!result)
return;
wantsWheelEvents = pluginControllerProxyPtr->wantsWheelEvents();
#if PLATFORM(MAC)
remoteLayerClientID = pluginControllerProxyPtr->remoteLayerClientID();
#else
UNUSED_PARAM(remoteLayerClientID);
#endif
}