本文整理汇总了C++中coreipc::ArgumentEncoder::encode方法的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentEncoder::encode方法的具体用法?C++ ArgumentEncoder::encode怎么用?C++ ArgumentEncoder::encode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coreipc::ArgumentEncoder
的用法示例。
在下文中一共展示了ArgumentEncoder::encode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: didReceiveSyncMessage
void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder& arguments, CoreIPC::ArgumentEncoder& reply)
{
switch (messageID.get<WebPageProxyMessage::Kind>()) {
case WebPageProxyMessage::CreateNewPage: {
WebPageProxy* newPage = createNewPage();
if (newPage) {
// FIXME: Pass the real size.
reply.encode(CoreIPC::In(newPage->pageID(), IntSize(100, 100),
newPage->pageNamespace()->context()->preferences()->store(),
*(newPage->m_drawingArea.get())));
} else {
// FIXME: We should encode a drawing area type here instead.
reply.encode(CoreIPC::In(static_cast<uint64_t>(0), IntSize(), WebPreferencesStore(), 0));
}
break;
}
case WebPageProxyMessage::RunJavaScriptAlert: {
uint64_t frameID;
String alertText;
if (!arguments.decode(CoreIPC::Out(frameID, alertText)))
return;
runJavaScriptAlert(webFrame(frameID), alertText);
break;
}
default:
ASSERT_NOT_REACHED();
break;
}
}
示例2: encode
void NetworkResourceLoadParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
encoder.encode(m_request);
encoder.encode(static_cast<bool>(m_request.httpBody()));
if (m_request.httpBody()) {
EncoderAdapter httpBodyEncoderAdapter;
m_request.httpBody()->encode(httpBodyEncoderAdapter);
encoder.encode(httpBodyEncoderAdapter.dataReference());
}
encoder.encodeEnum(m_priority);
encoder.encodeEnum(m_contentSniffingPolicy);
encoder.encodeEnum(m_allowStoredCredentials);
encoder.encode(m_inPrivateBrowsingMode);
}
示例3: encode
void NetworkResourceLoadParameters::encode(CoreIPC::ArgumentEncoder& encoder) const
{
encoder.encode(m_identifier);
encoder.encode(m_webPageID);
encoder.encode(m_webFrameID);
encoder.encode(m_request);
encoder.encode(static_cast<bool>(m_request.httpBody()));
if (m_request.httpBody()) {
EncoderAdapter httpBodyEncoderAdapter;
m_request.httpBody()->encode(httpBodyEncoderAdapter);
encoder.encode(httpBodyEncoderAdapter.dataReference());
const Vector<FormDataElement>& elements = m_request.httpBody()->elements();
size_t fileCount = 0;
for (size_t i = 0, count = elements.size(); i < count; ++i) {
if (elements[i].m_type == FormDataElement::encodedFile)
++fileCount;
}
SandboxExtension::HandleArray requestBodySandboxExtensions;
requestBodySandboxExtensions.allocate(fileCount);
size_t extensionIndex = 0;
for (size_t i = 0, count = elements.size(); i < count; ++i) {
const FormDataElement& element = elements[i];
if (element.m_type == FormDataElement::encodedFile) {
const String& path = element.m_shouldGenerateFile ? element.m_generatedFilename : element.m_filename;
SandboxExtension::createHandle(path, SandboxExtension::ReadOnly, requestBodySandboxExtensions[extensionIndex++]);
}
}
encoder.encode(requestBodySandboxExtensions);
}
if (m_request.url().isLocalFile()) {
SandboxExtension::Handle requestSandboxExtension;
SandboxExtension::createHandle(m_request.url().fileSystemPath(), SandboxExtension::ReadOnly, requestSandboxExtension);
encoder.encode(requestSandboxExtension);
}
encoder.encodeEnum(m_priority);
encoder.encodeEnum(m_contentSniffingPolicy);
encoder.encodeEnum(m_allowStoredCredentials);
encoder.encode(m_inPrivateBrowsingMode);
}