本文整理汇总了C++中coreipc::DataReference::data方法的典型用法代码示例。如果您正苦于以下问题:C++ DataReference::data方法的具体用法?C++ DataReference::data怎么用?C++ DataReference::data使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coreipc::DataReference
的用法示例。
在下文中一共展示了DataReference::data方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: manualStreamDidReceiveData
void PluginControllerProxy::manualStreamDidReceiveData(const CoreIPC::DataReference& data)
{
if (m_pluginCanceledManualStreamLoad)
return;
m_plugin->manualStreamDidReceiveData(reinterpret_cast<const char*>(data.data()), data.size());
}
示例2: create
static PassRefPtr<WebData> createWebData(const CoreIPC::DataReference& data)
{
if (data.isEmpty())
return 0;
return WebData::create(data.data(), data.size());
}
示例3: didHandleURIRequest
void WebSoupRequestManager::didHandleURIRequest(const CoreIPC::DataReference& requestData, uint64_t contentLength, const String& mimeType, uint64_t requestID)
{
WebSoupRequestAsyncData* data = m_requestMap.get(requestID);
ASSERT(data);
GRefPtr<GSimpleAsyncResult> result = data->releaseResult();
ASSERT(result.get());
GRefPtr<WebKitSoupRequestGeneric> request = adoptGRef(WEBKIT_SOUP_REQUEST_GENERIC(g_async_result_get_source_object(G_ASYNC_RESULT(result.get()))));
webkitSoupRequestGenericSetContentLength(request.get(), contentLength ? contentLength : -1);
webkitSoupRequestGenericSetContentType(request.get(), !mimeType.isEmpty() ? mimeType.utf8().data() : 0);
GInputStream* dataStream;
if (!requestData.size()) {
// Empty reply, just create and empty GMemoryInputStream.
dataStream = g_memory_input_stream_new();
m_requestMap.remove(requestID);
} else if (requestData.size() == contentLength) {
// We don't expect more data, so we can just create a GMemoryInputStream with all the data.
dataStream = g_memory_input_stream_new_from_data(g_memdup(requestData.data(), requestData.size()), contentLength, g_free);
m_requestMap.remove(requestID);
} else {
// We expect more data chunks from the UI process.
dataStream = webkitSoupRequestInputStreamNew(contentLength);
data->stream = dataStream;
webkitSoupRequestInputStreamAddData(WEBKIT_SOUP_REQUEST_INPUT_STREAM(dataStream), requestData.data(), requestData.size());
}
g_simple_async_result_set_op_res_gpointer(result.get(), dataStream, g_object_unref);
g_simple_async_result_complete(result.get());
}
示例4: decode
bool NetworkResourceLoadParameters::decode(CoreIPC::ArgumentDecoder* decoder, NetworkResourceLoadParameters& result)
{
if (!decoder->decode(result.m_request))
return false;
bool hasHTTPBody;
if (!decoder->decode(hasHTTPBody))
return false;
if (hasHTTPBody) {
CoreIPC::DataReference formData;
if (!decoder->decode(formData))
return false;
DecoderAdapter httpBodyDecoderAdapter(formData.data(), formData.size());
result.m_request.setHTTPBody(FormData::decode(httpBodyDecoderAdapter));
}
if (!decoder->decodeEnum(result.m_priority))
return false;
if (!decoder->decodeEnum(result.m_contentSniffingPolicy))
return false;
if (!decoder->decodeEnum(result.m_allowStoredCredentials))
return false;
if (!decoder->decode(result.m_inPrivateBrowsingMode))
return false;
return true;
}
示例5: setIconDataForIconURL
void WebIconDatabase::setIconDataForIconURL(const CoreIPC::DataReference& iconData, const String& iconURL)
{
LOG(IconDatabase, "WK2 UIProcess setting icon data (%i bytes) for page URL %s", (int)iconData.size(), iconURL.ascii().data());
if (!m_iconDatabaseImpl)
return;
RefPtr<SharedBuffer> buffer = SharedBuffer::create(iconData.data(), iconData.size());
m_iconDatabaseImpl->setIconDataForIconURL(buffer.release(), iconURL);
}
示例6: decode
bool decode(ArgumentDecoder* decoder, RetainPtr<CFDataRef>& result)
{
CoreIPC::DataReference dataReference;
if (!decoder->decode(dataReference))
return false;
result.adoptCF(CFDataCreate(0, dataReference.data(), dataReference.size()));
return true;
}
示例7: decode
bool NetworkResourceLoadParameters::decode(CoreIPC::ArgumentDecoder& decoder, NetworkResourceLoadParameters& result)
{
if (!decoder.decode(result.m_identifier))
return false;
if (!decoder.decode(result.m_webPageID))
return false;
if (!decoder.decode(result.m_webFrameID))
return false;
if (!decoder.decode(result.m_request))
return false;
bool hasHTTPBody;
if (!decoder.decode(hasHTTPBody))
return false;
if (hasHTTPBody) {
CoreIPC::DataReference formData;
if (!decoder.decode(formData))
return false;
DecoderAdapter httpBodyDecoderAdapter(formData.data(), formData.size());
result.m_request.setHTTPBody(FormData::decode(httpBodyDecoderAdapter));
if (!decoder.decode(result.m_requestBodySandboxExtensions))
return false;
}
if (result.m_request.url().isLocalFile()) {
if (!decoder.decode(result.m_resourceSandboxExtension))
return false;
}
if (!decoder.decodeEnum(result.m_priority))
return false;
if (!decoder.decodeEnum(result.m_contentSniffingPolicy))
return false;
if (!decoder.decodeEnum(result.m_allowStoredCredentials))
return false;
if (!decoder.decode(result.m_inPrivateBrowsingMode))
return false;
if (!decoder.decode(result.m_shouldClearReferrerOnHTTPSToHTTPRedirect))
return false;
return true;
}
示例8: postInjectedBundleMessage
void WebProcess::postInjectedBundleMessage(const CoreIPC::DataReference& messageData)
{
InjectedBundle* injectedBundle = WebProcess::shared().injectedBundle();
if (!injectedBundle)
return;
OwnPtr<CoreIPC::ArgumentDecoder> decoder = CoreIPC::ArgumentDecoder::create(messageData.data(), messageData.size());
String messageName;
if (!decoder->decode(messageName))
return;
RefPtr<APIObject> messageBody;
InjectedBundleUserMessageDecoder messageBodyDecoder(messageBody);
if (!decoder->decode(messageBodyDecoder))
return;
injectedBundle->didReceiveMessage(messageName, messageBody.get());
}
示例9: streamDidReceiveData
void PluginControllerProxy::streamDidReceiveData(uint64_t streamID, const CoreIPC::DataReference& data)
{
m_plugin->streamDidReceiveData(streamID, reinterpret_cast<const char*>(data.data()), data.size());
}
示例10: didReceiveURIRequestData
void WebSoupRequestManager::didReceiveURIRequestData(const CoreIPC::DataReference& requestData, uint64_t requestID)
{
WebSoupRequestAsyncData* data = m_requestMap.get(requestID);
// The data might have been removed from the request map if a previous chunk failed
// and a new message was sent by the UI process before being notified about the failure.
if (!data)
return;
ASSERT(data->stream.get());
if (data->requestFailed()) {
// ResourceRequest failed or it was cancelled. It doesn't matter here the error or if it was cancelled,
// because that's already handled by the resource handle client, we just want to notify the UI process
// to stop reading data from the user input stream. If UI process already sent all the data we simply
// finish silently.
if (!webkitSoupRequestInputStreamFinished(WEBKIT_SOUP_REQUEST_INPUT_STREAM(data->stream.get())))
m_process->connection()->send(Messages::WebSoupRequestManagerProxy::DidFailToLoadURIRequest(requestID), 0);
m_requestMap.remove(requestID);
return;
}
webkitSoupRequestInputStreamAddData(WEBKIT_SOUP_REQUEST_INPUT_STREAM(data->stream.get()), requestData.data(), requestData.size());
if (webkitSoupRequestInputStreamFinished(WEBKIT_SOUP_REQUEST_INPUT_STREAM(data->stream.get())))
m_requestMap.remove(requestID);
}