本文整理汇总了C++中parentProcessConnection函数的典型用法代码示例。如果您正苦于以下问题:C++ parentProcessConnection函数的具体用法?C++ parentProcessConnection怎么用?C++ parentProcessConnection使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parentProcessConnection函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: USE
void NetworkProcess::createNetworkConnectionToWebProcess()
{
#if USE(UNIX_DOMAIN_SOCKETS)
IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection();
RefPtr<NetworkConnectionToWebProcess> connection = NetworkConnectionToWebProcess::create(socketPair.server);
m_webProcessConnections.append(connection.release());
IPC::Attachment clientSocket(socketPair.client);
parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCreateNetworkConnectionToWebProcess(clientSocket), 0);
#elif OS(DARWIN)
// Create the listening port.
mach_port_t listeningPort;
mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
// Create a listening connection.
RefPtr<NetworkConnectionToWebProcess> connection = NetworkConnectionToWebProcess::create(IPC::Connection::Identifier(listeningPort));
m_webProcessConnections.append(connection.release());
IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCreateNetworkConnectionToWebProcess(clientPort), 0);
#else
notImplemented();
#endif
}
示例2: parentProcessConnection
void NetworkProcess::logDiagnosticMessageWithResult(uint64_t webPageID, const String& message, const String& description, WebCore::DiagnosticLoggingResultType result, WebCore::ShouldSample shouldSample)
{
if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
return;
parentProcessConnection()->send(Messages::NetworkProcessProxy::LogSampledDiagnosticMessageWithResult(webPageID, message, description, result), 0);
}
示例3: hashForPlugInOrigin
void WebProcess::plugInDidReceiveUserInteraction(const String& pageOrigin, const String& pluginOrigin, const String& mimeType, SessionID sessionID)
{
if (pageOrigin.isEmpty())
return;
unsigned plugInOriginHash = hashForPlugInOrigin(pageOrigin, pluginOrigin, mimeType);
if (!plugInOriginHash)
return;
HashMap<WebCore::SessionID, HashMap<unsigned, double>>::const_iterator sessionIterator = m_plugInAutoStartOriginHashes.find(sessionID);
HashMap<unsigned, double>::const_iterator it;
bool contains = false;
if (sessionIterator != m_plugInAutoStartOriginHashes.end()) {
it = sessionIterator->value.find(plugInOriginHash);
contains = it != sessionIterator->value.end();
}
if (!contains) {
sessionIterator = m_plugInAutoStartOriginHashes.find(SessionID::defaultSessionID());
it = sessionIterator->value.find(plugInOriginHash);
if (it == sessionIterator->value.end())
return;
}
if (it->value - currentTime() > plugInAutoStartExpirationTimeUpdateThreshold)
return;
parentProcessConnection()->send(Messages::WebProcessPool::PlugInDidReceiveUserInteraction(plugInOriginHash, sessionID), 0);
}
示例4: ensureNetworkProcessConnection
void WebProcess::ensureNetworkProcessConnection()
{
if (!m_usesNetworkProcess)
return;
if (m_networkProcessConnection)
return;
IPC::Attachment encodedConnectionIdentifier;
if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetNetworkProcessConnection(),
Messages::WebProcessProxy::GetNetworkProcessConnection::Reply(encodedConnectionIdentifier), 0))
return;
#if OS(DARWIN)
IPC::Connection::Identifier connectionIdentifier(encodedConnectionIdentifier.port());
#elif USE(UNIX_DOMAIN_SOCKETS)
IPC::Connection::Identifier connectionIdentifier = encodedConnectionIdentifier.releaseFileDescriptor();
#else
ASSERT_NOT_REACHED();
#endif
if (IPC::Connection::identifierIsNull(connectionIdentifier))
return;
m_networkProcessConnection = NetworkProcessConnection::create(connectionIdentifier);
}
示例5: CallbackAggregator
void DatabaseProcess::deleteWebsiteData(WebCore::SessionID, uint64_t websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID)
{
struct CallbackAggregator final : public ThreadSafeRefCounted<CallbackAggregator> {
explicit CallbackAggregator(std::function<void ()> completionHandler)
: m_completionHandler(WTFMove(completionHandler))
{
}
~CallbackAggregator()
{
ASSERT(RunLoop::isMain());
RunLoop::main().dispatch(WTFMove(m_completionHandler));
}
std::function<void ()> m_completionHandler;
};
RefPtr<CallbackAggregator> callbackAggregator = adoptRef(new CallbackAggregator([this, callbackID]() {
parentProcessConnection()->send(Messages::DatabaseProcessProxy::DidDeleteWebsiteData(callbackID), 0);
}));
#if ENABLE(INDEXED_DATABASE)
if (websiteDataTypes & WebsiteDataTypeIndexedDBDatabases) {
postDatabaseTask(std::make_unique<CrossThreadTask>([this, callbackAggregator, modifiedSince] {
deleteIndexedDatabaseEntriesModifiedSince(modifiedSince);
RunLoop::main().dispatch([callbackAggregator] { });
}));
}
#endif
}
示例6: PLATFORM
void NetworkProcess::deleteWebsiteData(SessionID sessionID, uint64_t websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID)
{
#if PLATFORM(COCOA)
if (websiteDataTypes & WebsiteDataTypeHSTSCache) {
if (auto* networkStorageSession = SessionTracker::storageSession(sessionID))
clearHSTSCache(*networkStorageSession, modifiedSince);
}
#endif
if (websiteDataTypes & WebsiteDataTypeCookies) {
if (auto* networkStorageSession = SessionTracker::storageSession(sessionID))
deleteAllCookiesModifiedSince(*networkStorageSession, modifiedSince);
}
auto completionHandler = [this, callbackID] {
parentProcessConnection()->send(Messages::NetworkProcessProxy::DidDeleteWebsiteData(callbackID), 0);
};
if ((websiteDataTypes & WebsiteDataTypeDiskCache) && !sessionID.isEphemeral()) {
clearDiskCache(modifiedSince, WTFMove(completionHandler));
return;
}
completionHandler();
}
示例7: parentProcessConnection
void NetworkProcess::logDiagnosticMessageWithValue(uint64_t webPageID, const String& message, const String& description, const String& value, ShouldSample shouldSample)
{
if (!DiagnosticLoggingClient::shouldLogAfterSampling(shouldSample))
return;
parentProcessConnection()->send(Messages::NetworkProcessProxy::LogSampledDiagnosticMessageWithValue(webPageID, message, description, value), 0);
}
示例8: parentProcessConnection
void WebProcess::processSuspensionCleanupTimerFired()
{
if (!markAllLayersVolatileIfPossible())
return;
m_processSuspensionCleanupTimer.stop();
if (m_shouldAcknowledgeWhenReadyToSuspend == ShouldAcknowledgeWhenReadyToSuspend::Yes)
parentProcessConnection()->send(Messages::WebProcessProxy::ProcessReadyToSuspend(), 0);
}
示例9: parentProcessConnection
void PluginProcess::getSitesWithData(uint64_t callbackID)
{
Vector<String> sites;
if (NetscapePluginModule* module = netscapePluginModule())
sites = module->sitesWithData();
parentProcessConnection()->send(Messages::PluginProcessProxy::DidGetSitesWithData(sites, callbackID), 0);
}
示例10: OS
void PluginProcess::createWebProcessConnection()
{
bool didHaveAnyWebProcessConnections = !m_webProcessConnections.isEmpty();
#if OS(DARWIN)
// Create the listening port.
mach_port_t listeningPort;
mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort);
// Create a listening connection.
RefPtr<WebProcessConnection> connection = WebProcessConnection::create(IPC::Connection::Identifier(listeningPort));
if (m_audioHardwareListener) {
if (m_audioHardwareListener->hardwareActivity() == WebCore::AudioHardwareActivityType::IsActive)
connection->audioHardwareDidBecomeActive();
else if (m_audioHardwareListener->hardwareActivity() == WebCore::AudioHardwareActivityType::IsInactive)
connection->audioHardwareDidBecomeInactive();
}
m_webProcessConnections.append(connection.release());
IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND);
parentProcessConnection()->send(Messages::PluginProcessProxy::DidCreateWebProcessConnection(clientPort, m_supportsAsynchronousPluginInitialization), 0);
#elif USE(UNIX_DOMAIN_SOCKETS)
IPC::Connection::SocketPair socketPair = IPC::Connection::createPlatformConnection();
RefPtr<WebProcessConnection> connection = WebProcessConnection::create(socketPair.server);
m_webProcessConnections.append(connection.release());
IPC::Attachment clientSocket(socketPair.client);
parentProcessConnection()->send(Messages::PluginProcessProxy::DidCreateWebProcessConnection(clientSocket, m_supportsAsynchronousPluginInitialization), 0);
#else
notImplemented();
#endif
if (NetscapePluginModule* module = netscapePluginModule()) {
if (!didHaveAnyWebProcessConnections) {
// Increment the load count. This is matched by a call to decrementLoadCount in removeWebProcessConnection.
// We do this so that the plug-in module's NP_Shutdown won't be called until right before exiting.
module->incrementLoadCount();
}
}
disableTermination();
}
示例11: LOG
void WebProcess::addPlugInAutoStartOrigin(const String& pageOrigin, unsigned plugInOriginHash)
{
if (isPlugInAutoStartOrigin(plugInOriginHash)) {
LOG(Plugins, "Hash %x already exists as auto-start origin (request for %s)", plugInOriginHash, pageOrigin.utf8().data());
return;
}
parentProcessConnection()->send(Messages::WebContext::AddPlugInAutoStartOriginHash(pageOrigin, plugInOriginHash), 0);
}
示例12: setAllLayerTreeStatesFrozen
void WebProcess::cancelPrepareToSuspend()
{
setAllLayerTreeStatesFrozen(false);
// If we've already finished cleaning up and sent ProcessReadyToSuspend, we
// shouldn't send DidCancelProcessSuspension; the UI process strictly expects one or the other.
if (!m_processSuspensionCleanupTimer.isActive())
return;
m_processSuspensionCleanupTimer.stop();
parentProcessConnection()->send(Messages::WebProcessProxy::DidCancelProcessSuspension(), 0);
}
示例13: ASSERT
bool WebProcess::shouldTerminate()
{
ASSERT(m_pageMap.isEmpty());
ASSERT(usesNetworkProcess() || !downloadManager().isDownloading());
// FIXME: the ShouldTerminate message should also send termination parameters, such as any session cookies that need to be preserved.
bool shouldTerminate = false;
if (parentProcessConnection()->sendSync(Messages::WebProcessProxy::ShouldTerminate(), Messages::WebProcessProxy::ShouldTerminate::Reply(shouldTerminate), 0)
&& !shouldTerminate)
return false;
return true;
}
示例14: parentProcessConnection
void WebProcess::plugInDidReceiveUserInteraction(unsigned plugInOriginHash)
{
if (!plugInOriginHash)
return;
HashMap<unsigned, double>::iterator it = m_plugInAutoStartOrigins.find(plugInOriginHash);
if (it == m_plugInAutoStartOrigins.end())
return;
if (it->value - currentTime() > plugInAutoStartExpirationTimeUpdateThreshold)
return;
parentProcessConnection()->send(Messages::WebContext::PlugInDidReceiveUserInteraction(plugInOriginHash), 0);
}
示例15: UNUSED_PARAM
void WebProcess::deleteWebsiteData(SessionID sessionID, uint64_t websiteDataTypes, std::chrono::system_clock::time_point modifiedSince, uint64_t callbackID)
{
UNUSED_PARAM(modifiedSince);
if (websiteDataTypes & WebsiteDataTypeMemoryCache) {
PageCache::singleton().pruneToSizeNow(0, PruningReason::None);
MemoryCache::singleton().evictResources(sessionID);
CrossOriginPreflightResultCache::singleton().empty();
}
parentProcessConnection()->send(Messages::WebProcessProxy::DidDeleteWebsiteData(callbackID), 0);
}