本文整理汇总了C++中PassRefPtrWillBeRawPtr::blobDataHandle方法的典型用法代码示例。如果您正苦于以下问题:C++ PassRefPtrWillBeRawPtr::blobDataHandle方法的具体用法?C++ PassRefPtrWillBeRawPtr::blobDataHandle怎么用?C++ PassRefPtrWillBeRawPtr::blobDataHandle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PassRefPtrWillBeRawPtr
的用法示例。
在下文中一共展示了PassRefPtrWillBeRawPtr::blobDataHandle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendBeacon
bool BeaconLoader::sendBeacon(LocalFrame* frame, int allowance, const KURL& beaconURL, PassRefPtrWillBeRawPtr<Blob>& data, int& payloadLength)
{
ASSERT(data);
unsigned long long entitySize = data->size();
if (allowance > 0 && static_cast<unsigned long long>(allowance) < entitySize)
return false;
ResourceRequest request(beaconURL);
prepareRequest(frame, request);
RefPtr<FormData> entityBody = FormData::create();
if (data->hasBackingFile())
entityBody->appendFile(toFile(data.get())->path());
else
entityBody->appendBlob(data->uuid(), data->blobDataHandle());
request.setHTTPBody(entityBody.release());
AtomicString contentType;
const String& blobType = data->type();
if (!blobType.isEmpty() && isValidContentType(blobType))
request.setHTTPContentType(AtomicString(contentType));
issueRequest(frame, request);
payloadLength = entitySize;
return true;
}