本文整理汇总了C++中ipc::ArgumentEncoder::buffer方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentEncoder::buffer方法的具体用法?C++ ArgumentEncoder::buffer怎么用?C++ ArgumentEncoder::buffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipc::ArgumentEncoder
的用法示例。
在下文中一共展示了ArgumentEncoder::buffer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Coder<WebCore::CertificateInfo>::encode(Encoder& encoder, const WebCore::CertificateInfo& certificateInfo)
{
// FIXME: Cocoa CertificateInfo is a CF object tree. Generalize CF type coding so we don't need to use ArgumentCoder here.
IPC::ArgumentEncoder argumentEncoder;
argumentEncoder << certificateInfo;
encoder << static_cast<uint64_t>(argumentEncoder.bufferSize());
encoder.encodeFixedLengthData(argumentEncoder.buffer(), argumentEncoder.bufferSize());
}
示例2: postMessageToInjectedBundle
void WebContext::postMessageToInjectedBundle(const String& messageName, API::Object* messageBody)
{
if (m_processes.isEmpty()) {
if (m_processModel == ProcessModelSharedSecondaryProcess)
m_messagesToInjectedBundlePostedToEmptyContext.append(std::make_pair(messageName, messageBody));
return;
}
for (auto& process : m_processes) {
// FIXME: Return early if the message body contains any references to WKPageRefs/WKFrameRefs etc. since they're local to a process.
IPC::ArgumentEncoder messageData;
messageData.encode(messageName);
messageData.encode(WebContextUserMessageEncoder(messageBody, *process.get()));
process->send(Messages::WebProcess::PostInjectedBundleMessage(IPC::DataReference(messageData.buffer(), messageData.bufferSize())), 0);
}
}
示例3: ENABLE
//.........这里部分代码省略.........
parameters.databaseDirectory = databaseDirectory();
if (!parameters.databaseDirectory.isEmpty())
SandboxExtension::createHandleForReadWriteDirectory(parameters.databaseDirectory, parameters.databaseDirectoryExtensionHandle);
parameters.diskCacheDirectory = diskCacheDirectory();
if (!parameters.diskCacheDirectory.isEmpty())
SandboxExtension::createHandleForReadWriteDirectory(parameters.diskCacheDirectory, parameters.diskCacheDirectoryExtensionHandle);
parameters.cookieStorageDirectory = cookieStorageDirectory();
if (!parameters.cookieStorageDirectory.isEmpty())
SandboxExtension::createHandleForReadWriteDirectory(parameters.cookieStorageDirectory, parameters.cookieStorageDirectoryExtensionHandle);
parameters.shouldUseTestingNetworkSession = m_shouldUseTestingNetworkSession;
parameters.cacheModel = m_cacheModel;
parameters.languages = userPreferredLanguages();
copyToVector(m_schemesToRegisterAsEmptyDocument, parameters.urlSchemesRegistererdAsEmptyDocument);
copyToVector(m_schemesToRegisterAsSecure, parameters.urlSchemesRegisteredAsSecure);
copyToVector(m_schemesToSetDomainRelaxationForbiddenFor, parameters.urlSchemesForWhichDomainRelaxationIsForbidden);
copyToVector(m_schemesToRegisterAsLocal, parameters.urlSchemesRegisteredAsLocal);
copyToVector(m_schemesToRegisterAsNoAccess, parameters.urlSchemesRegisteredAsNoAccess);
copyToVector(m_schemesToRegisterAsDisplayIsolated, parameters.urlSchemesRegisteredAsDisplayIsolated);
copyToVector(m_schemesToRegisterAsCORSEnabled, parameters.urlSchemesRegisteredAsCORSEnabled);
#if ENABLE(CACHE_PARTITIONING)
copyToVector(m_schemesToRegisterAsCachePartitioned, parameters.urlSchemesRegisteredAsCachePartitioned);
#endif
parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath;
parameters.shouldUseFontSmoothing = m_shouldUseFontSmoothing;
parameters.iconDatabaseEnabled = !iconDatabasePath().isEmpty();
parameters.terminationTimeout = (m_processModel == ProcessModelSharedSecondaryProcess) ? sharedSecondaryProcessShutdownTimeout : 0;
parameters.textCheckerState = TextChecker::state();
parameters.fullKeyboardAccessEnabled = WebProcessProxy::fullKeyboardAccessEnabled();
parameters.defaultRequestTimeoutInterval = API::URLRequest::defaultTimeoutInterval();
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
// FIXME: There should be a generic way for supplements to add to the intialization parameters.
supplement<WebNotificationManagerProxy>()->populateCopyOfNotificationPermissions(parameters.notificationPermissions);
#endif
#if ENABLE(NETWORK_PROCESS)
parameters.usesNetworkProcess = m_usesNetworkProcess;
#endif
parameters.plugInAutoStartOriginHashes = m_plugInAutoStartProvider.autoStartOriginHashesCopy();
copyToVector(m_plugInAutoStartProvider.autoStartOrigins(), parameters.plugInAutoStartOrigins);
parameters.memoryCacheDisabled = m_memoryCacheDisabled;
#if ENABLE(SERVICE_CONTROLS)
parameters.hasImageServices = ServicesController::shared().hasImageServices();
parameters.hasSelectionServices = ServicesController::shared().hasSelectionServices();
ServicesController::shared().refreshExistingServices(this);
#endif
// Add any platform specific parameters
platformInitializeWebProcess(parameters);
RefPtr<API::Object> injectedBundleInitializationUserData = m_injectedBundleClient.getInjectedBundleInitializationUserData(this);
if (!injectedBundleInitializationUserData)
injectedBundleInitializationUserData = m_injectedBundleInitializationUserData;
process->send(Messages::WebProcess::InitializeWebProcess(parameters, WebContextUserMessageEncoder(injectedBundleInitializationUserData.get(), *process)), 0);
#if PLATFORM(COCOA)
process->send(Messages::WebProcess::SetQOS(webProcessLatencyQOS(), webProcessThroughputQOS()), 0);
#endif
if (WebPreferences::anyPagesAreUsingPrivateBrowsing())
process->send(Messages::WebProcess::EnsurePrivateBrowsingSession(SessionID::legacyPrivateSessionID()), 0);
m_processes.append(process);
if (m_processModel == ProcessModelSharedSecondaryProcess) {
for (size_t i = 0; i != m_messagesToInjectedBundlePostedToEmptyContext.size(); ++i) {
std::pair<String, RefPtr<API::Object>>& message = m_messagesToInjectedBundlePostedToEmptyContext[i];
IPC::ArgumentEncoder messageData;
messageData.encode(message.first);
messageData.encode(WebContextUserMessageEncoder(message.second.get(), *process));
process->send(Messages::WebProcess::PostInjectedBundleMessage(IPC::DataReference(messageData.buffer(), messageData.bufferSize())), 0);
}
m_messagesToInjectedBundlePostedToEmptyContext.clear();
} else
ASSERT(m_messagesToInjectedBundlePostedToEmptyContext.isEmpty());
#if ENABLE(REMOTE_INSPECTOR)
// Initialize remote inspector connection now that we have a sub-process that is hosting one of our web views.
Inspector::RemoteInspector::shared();
#endif
return *process;
}