本文整理汇总了C++中WebData类的典型用法代码示例。如果您正苦于以下问题:C++ WebData类的具体用法?C++ WebData怎么用?C++ WebData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WebData类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: appendData
void WebHTTPBody::appendData(const WebData& data)
{
ensureMutable();
// FIXME: FormDataElement::m_data should be a SharedBuffer<char>. Then we
// could avoid this buffer copy.
m_private->appendData(data.data(), data.size());
}
开发者ID:Miaque,项目名称:mojo,代码行数:7,代码来源:WebHTTPBody.cpp
示例2: loadTestData
void loadTestData(const char* fileName)
{
String fullPath(Platform::current()->unitTestSupport()->webKitRootDir());
fullPath.append("/Source/core/paint/test_data/");
fullPath.append(fileName);
WebData inputBuffer = Platform::current()->unitTestSupport()->readFromFile(fullPath);
setBodyInnerHTML(String(inputBuffer.data(), inputBuffer.size()));
}
开发者ID:azureplus,项目名称:chromium,代码行数:8,代码来源:PaintPropertyTreeBuilderTest.cpp
示例3: didReceiveData
void SocketStreamHandleInternal::didReceiveData(WebSocketStreamHandle* socketHandle, const WebData& data)
{
LOG(Network, "didReceiveData");
if (m_handle && m_socket.get()) {
ASSERT(socketHandle == m_socket.get());
if (m_handle->m_client)
m_handle->m_client->didReceiveData(m_handle, data.data(), data.size());
}
}
开发者ID:KDE,项目名称:android-qtwebkit,代码行数:9,代码来源:SocketStreamHandle.cpp
示例4: adoptPtr
void ResourceLoader::requestSynchronously()
{
OwnPtr<WebURLLoader> loader = adoptPtr(Platform::current()->createURLLoader());
ASSERT(loader);
// downloadToFile is not supported for synchronous requests.
ASSERT(!m_request.downloadToFile());
ResourcePtr<Resource> protectResource(m_resource);
RELEASE_ASSERT(m_connectionState == ConnectionStateNew);
m_connectionState = ConnectionStateStarted;
WrappedResourceRequest requestIn(m_request);
WebURLResponse responseOut;
responseOut.initialize();
WebURLError errorOut;
WebData dataOut;
loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut);
if (errorOut.reason) {
if (m_state == Terminated) {
// A message dispatched while synchronously fetching the resource
// can bring about the cancellation of this load.
ASSERT(!m_resource);
return;
}
didFail(0, errorOut);
return;
}
didReceiveResponse(0, responseOut);
if (m_state == Terminated)
return;
RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse().resourceLoadInfo();
int64_t encodedDataLength = resourceLoadInfo ? resourceLoadInfo->encodedDataLength : WebURLLoaderClient::kUnknownEncodedDataLength;
// Follow the async case convention of not calling didReceiveData or
// appending data to m_resource if the response body is empty. Copying the
// empty buffer is a noop in most cases, but is destructive in the case of
// a 304, where it will overwrite the cached data we should be reusing.
if (dataOut.size()) {
m_fetcher->didReceiveData(m_resource, dataOut.data(), dataOut.size(), encodedDataLength);
m_resource->setResourceBuffer(dataOut);
}
didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:45,代码来源:ResourceLoader.cpp
示例5: didLoadIcon
void WebIconLoadingCompletionImpl::didLoadIcon(const WebData& iconData)
{
if (!iconData.isEmpty()) {
RefPtr<Image> image = BitmapImage::create();
image->setData(iconData, true);
m_fileIconLoader->notifyFinished(Icon::create(image));
}
// This object is no longer needed.
delete this;
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:10,代码来源:WebIconLoadingCompletionImpl.cpp
示例6: loader
// static
void ResourceHandle::loadResourceSynchronously(NetworkingContext* context,
const ResourceRequest& request,
StoredCredentials storedCredentials,
ResourceError& error,
ResourceResponse& response,
Vector<char>& data)
{
OwnPtr<WebURLLoader> loader(webKitClient()->createURLLoader());
ASSERT(loader.get());
WrappedResourceRequest requestIn(request);
requestIn.setAllowStoredCredentials(storedCredentials == AllowStoredCredentials);
WrappedResourceResponse responseOut(response);
WebURLError errorOut;
WebData dataOut;
loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut);
error = errorOut;
data.clear();
data.append(dataOut.data(), dataOut.size());
}
开发者ID:mcgrawp,项目名称:webkit-webcl,代码行数:23,代码来源:ResourceHandle.cpp
示例7: adoptPtr
void ResourceLoader::requestSynchronously()
{
OwnPtr<WebURLLoader> loader = adoptPtr(Platform::current()->createURLLoader());
ASSERT(loader);
// downloadToFile is not supported for synchronous requests.
ASSERT(!m_request.downloadToFile());
ResourcePtr<Resource> protectResource(m_resource);
RELEASE_ASSERT(m_connectionState == ConnectionStateNew);
m_connectionState = ConnectionStateStarted;
WrappedResourceRequest requestIn(m_request);
WebURLResponse responseOut;
responseOut.initialize();
WebURLError errorOut;
WebData dataOut;
loader->loadSynchronously(requestIn, responseOut, errorOut, dataOut);
if (errorOut.reason) {
if (m_state == Terminated) {
// A message dispatched while synchronously fetching the resource
// can bring about the cancellation of this load.
ASSERT(!m_resource);
return;
}
didFail(0, errorOut);
return;
}
didReceiveResponse(0, responseOut);
if (m_state == Terminated)
return;
RefPtr<ResourceLoadInfo> resourceLoadInfo = responseOut.toResourceResponse().resourceLoadInfo();
int64_t encodedDataLength = resourceLoadInfo ? resourceLoadInfo->encodedDataLength : WebURLLoaderClient::kUnknownEncodedDataLength;
m_fetcher->didReceiveData(m_resource, dataOut.data(), dataOut.size(), encodedDataLength);
m_resource->setResourceBuffer(dataOut);
didFinishLoading(0, monotonicallyIncreasingTime(), encodedDataLength);
}
开发者ID:alexanderbill,项目名称:blink-crosswalk,代码行数:38,代码来源:ResourceLoader.cpp
注:本文中的WebData类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论