本文整理汇总了C++中ipc::DataReference::vector方法的典型用法代码示例。如果您正苦于以下问题:C++ DataReference::vector方法的具体用法?C++ DataReference::vector怎么用?C++ DataReference::vector使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipc::DataReference
的用法示例。
在下文中一共展示了DataReference::vector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Vector<uint8_t> CompositingManager::authenticate()
{
IPC::DataReference data;
m_connection->sendSync(Messages::CompositingManagerProxy::Authenticate(),
Messages::CompositingManagerProxy::Authenticate::Reply(data), 0);
return data.vector();
}
示例2: decodeBytes
bool DecoderAdapter::decodeBytes(Vector<uint8_t>& bytes)
{
IPC::DataReference dataReference;
if (!m_decoder.decode(dataReference))
return false;
bytes = dataReference.vector();
return true;
}
示例3: didPostMessage
void WebUserContentControllerProxy::didPostMessage(IPC::Connection& connection, uint64_t pageID, uint64_t frameID, const WebCore::SecurityOriginData& securityOrigin, uint64_t messageHandlerID, const IPC::DataReference& dataReference)
{
WebPageProxy* page = WebProcessProxy::webPage(pageID);
if (!page)
return;
WebProcessProxy* webProcess = WebProcessProxy::fromConnection(&connection);
WebFrameProxy* frame = webProcess->webFrame(frameID);
if (!frame)
return;
if (!HashMap<uint64_t, RefPtr<WebScriptMessageHandler>>::isValidKey(messageHandlerID))
return;
RefPtr<WebScriptMessageHandler> handler = m_scriptMessageHandlers.get(messageHandlerID);
if (!handler)
return;
auto buffer = dataReference.vector();
RefPtr<WebCore::SerializedScriptValue> value = WebCore::SerializedScriptValue::adopt(buffer);
handler->client().didPostMessage(*page, *frame, securityOrigin, *value);
}
示例4: decode
bool UserData::decode(IPC::ArgumentDecoder& decoder, RefPtr<API::Object>& result)
{
API::Object::Type type;
if (!decoder.decodeEnum(type))
return false;
switch (type) {
case API::Object::Type::Array: {
uint64_t size;
if (!decoder.decode(size))
return false;
Vector<RefPtr<API::Object>> elements;
for (size_t i = 0; i < size; ++i) {
RefPtr<API::Object> element;
if (!decode(decoder, element))
return false;
elements.append(std::move(element));
}
result = API::Array::create(std::move(elements));
break;
}
case API::Object::Type::Boolean:
if (!API::Boolean::decode(decoder, result))
return false;
break;
case API::Object::Type::Data:
if (!API::Data::decode(decoder, result))
return false;
break;
case API::Object::Type::Dictionary: {
uint64_t size;
if (!decoder.decode(size))
return false;
ImmutableDictionary::MapType map;
for (size_t i = 0; i < size; ++i) {
String key;
if (!decoder.decode(key))
return false;
RefPtr<API::Object> value;
if (!decode(decoder, value))
return false;
if (!map.add(std::move(key), std::move(value)).isNewEntry)
return false;
}
result = ImmutableDictionary::create(std::move(map));
break;
}
case API::Object::Type::Double:
if (!API::Double::decode(decoder, result))
return false;
break;
case API::Object::Type::Error:
if (!API::Error::decode(decoder, result))
return false;
break;
case API::Object::Type::FrameHandle: {
uint64_t frameID;
if (!decoder.decode(frameID))
return false;
result = API::FrameHandle::create(frameID);
break;
}
case API::Object::Type::Null:
result = nullptr;
break;
case API::Object::Type::Point:
if (!API::Point::decode(decoder, result))
return false;
break;
case API::Object::Type::Rect:
if (!API::Rect::decode(decoder, result))
return false;
break;
case API::Object::Type::SerializedScriptValue: {
IPC::DataReference dataReference;
if (!decoder.decode(dataReference))
return false;
auto vector = dataReference.vector();
result = WebSerializedScriptValue::adopt(vector);
break;
}
//.........这里部分代码省略.........