本文整理汇总了C++中ArgumentEncoder类的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentEncoder类的具体用法?C++ ArgumentEncoder怎么用?C++ ArgumentEncoder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArgumentEncoder类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: encodeTimingFunction
static void encodeTimingFunction(ArgumentEncoder& encoder, const TimingFunction* timingFunction)
{
if (!timingFunction) {
encoder.encodeEnum(TimingFunction::TimingFunctionType(-1));
return;
}
TimingFunction::TimingFunctionType type = timingFunction ? timingFunction->type() : TimingFunction::LinearFunction;
encoder.encodeEnum(type);
switch (type) {
case TimingFunction::LinearFunction:
break;
case TimingFunction::CubicBezierFunction: {
const CubicBezierTimingFunction* cubic = static_cast<const CubicBezierTimingFunction*>(timingFunction);
encoder << cubic->x1();
encoder << cubic->y1();
encoder << cubic->x2();
encoder << cubic->y2();
break;
}
case TimingFunction::StepsFunction: {
const StepsTimingFunction* steps = static_cast<const StepsTimingFunction*>(timingFunction);
encoder << static_cast<uint32_t>(steps->numberOfSteps());
encoder << steps->stepAtStart();
break;
}
}
}
示例2:
void ArgumentCoder<WebCore::UserScript>::encode(ArgumentEncoder& encoder, const WebCore::UserScript& userScript)
{
encoder << userScript.source();
encoder << userScript.url();
encoder << userScript.whitelist();
encoder << userScript.blacklist();
encoder.encodeEnum(userScript.injectionTime());
encoder.encodeEnum(userScript.injectedFrames());
}
示例3:
void ArgumentCoder<WebCore::CustomFilterProgramInfo>::encode(ArgumentEncoder& encoder, const CustomFilterProgramInfo& programInfo)
{
encoder << programInfo.vertexShaderString();
encoder << programInfo.fragmentShaderString();
encoder.encodeEnum(programInfo.programType());
encoder.encodeEnum(programInfo.meshType());
const CustomFilterProgramMixSettings& mixSettings = programInfo.mixSettings();
encoder.encodeEnum(mixSettings.blendMode);
encoder.encodeEnum(mixSettings.compositeOperator);
}
示例4: switch
void ArgumentCoder<TransformOperations>::encode(ArgumentEncoder& encoder, const TransformOperations& transformOperations)
{
encoder << static_cast<uint32_t>(transformOperations.size());
for (size_t i = 0; i < transformOperations.size(); ++i) {
const TransformOperation* operation = transformOperations.at(i);
encoder.encodeEnum(operation->getOperationType());
switch (operation->getOperationType()) {
case TransformOperation::SCALE_X:
case TransformOperation::SCALE_Y:
case TransformOperation::SCALE:
case TransformOperation::SCALE_Z:
case TransformOperation::SCALE_3D:
encoder << static_cast<const ScaleTransformOperation*>(operation)->x();
encoder << static_cast<const ScaleTransformOperation*>(operation)->y();
encoder << static_cast<const ScaleTransformOperation*>(operation)->z();
break;
case TransformOperation::TRANSLATE_X:
case TransformOperation::TRANSLATE_Y:
case TransformOperation::TRANSLATE:
case TransformOperation::TRANSLATE_Z:
case TransformOperation::TRANSLATE_3D:
ArgumentCoder<Length>::encode(encoder, static_cast<const TranslateTransformOperation*>(operation)->x());
ArgumentCoder<Length>::encode(encoder, static_cast<const TranslateTransformOperation*>(operation)->y());
ArgumentCoder<Length>::encode(encoder, static_cast<const TranslateTransformOperation*>(operation)->z());
break;
case TransformOperation::ROTATE:
case TransformOperation::ROTATE_X:
case TransformOperation::ROTATE_Y:
case TransformOperation::ROTATE_3D:
encoder << static_cast<const RotateTransformOperation*>(operation)->x();
encoder << static_cast<const RotateTransformOperation*>(operation)->y();
encoder << static_cast<const RotateTransformOperation*>(operation)->z();
encoder << static_cast<const RotateTransformOperation*>(operation)->angle();
break;
case TransformOperation::SKEW_X:
case TransformOperation::SKEW_Y:
case TransformOperation::SKEW:
encoder << static_cast<const SkewTransformOperation*>(operation)->angleX();
encoder << static_cast<const SkewTransformOperation*>(operation)->angleY();
break;
case TransformOperation::MATRIX:
ArgumentCoder<TransformationMatrix>::encode(encoder, static_cast<const MatrixTransformOperation*>(operation)->matrix());
break;
case TransformOperation::MATRIX_3D:
ArgumentCoder<TransformationMatrix>::encode(encoder, static_cast<const Matrix3DTransformOperation*>(operation)->matrix());
break;
case TransformOperation::PERSPECTIVE:
ArgumentCoder<Length>::encode(encoder, static_cast<const PerspectiveTransformOperation*>(operation)->perspective());
break;
case TransformOperation::IDENTITY:
break;
case TransformOperation::NONE:
ASSERT_NOT_REACHED();
break;
}
}
}
示例5: encode
void encode(ArgumentEncoder& encoder, CFTypeRef typeRef)
{
CFType type = typeFromCFTypeRef(typeRef);
encoder.encodeEnum(type);
switch (type) {
case CFArray:
encode(encoder, static_cast<CFArrayRef>(typeRef));
return;
case CFBoolean:
encode(encoder, static_cast<CFBooleanRef>(typeRef));
return;
case CFData:
encode(encoder, static_cast<CFDataRef>(typeRef));
return;
case CFDate:
encode(encoder, static_cast<CFDateRef>(typeRef));
return;
case CFDictionary:
encode(encoder, static_cast<CFDictionaryRef>(typeRef));
return;
case CFNull:
return;
case CFNumber:
encode(encoder, static_cast<CFNumberRef>(typeRef));
return;
case CFString:
encode(encoder, static_cast<CFStringRef>(typeRef));
return;
case CFURL:
encode(encoder, static_cast<CFURLRef>(typeRef));
return;
case SecCertificate:
encode(encoder, (SecCertificateRef)typeRef);
return;
#if PLATFORM(IOS)
case SecIdentity:
encode(encoder, (SecIdentityRef)(typeRef));
return;
#endif
#if HAVE(SEC_KEYCHAIN)
case SecKeychainItem:
encode(encoder, (SecKeychainItemRef)typeRef);
return;
#endif
#if HAVE(SEC_ACCESS_CONTROL)
case SecAccessControl:
encode(encoder, (SecAccessControlRef)typeRef);
return;
#endif
case Null:
return;
case Unknown:
break;
}
ASSERT_NOT_REACHED();
}
示例6: sizeof
void ArgumentCoder<String>::encode(ArgumentEncoder& encoder, const String& string)
{
// Special case the null string.
if (string.isNull()) {
encoder << std::numeric_limits<uint32_t>::max();
return;
}
uint32_t length = string.length();
bool is8Bit = string.is8Bit();
encoder << length << is8Bit;
if (is8Bit)
encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters8()), length * sizeof(LChar), alignof(LChar));
else
encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.characters16()), length * sizeof(UChar), alignof(UChar));
}
示例7:
void ArgumentCoder<CString>::encode(ArgumentEncoder& encoder, const CString& string)
{
// Special case the null string.
if (string.isNull()) {
encoder << std::numeric_limits<uint32_t>::max();
return;
}
uint32_t length = string.length();
encoder << length;
encoder.encodeFixedLengthData(reinterpret_cast<const uint8_t*>(string.data()), length, 1);
}
示例8:
void ArgumentCoder<ResourceRequest>::encodePlatformData(ArgumentEncoder& encoder, const ResourceRequest& resourceRequest)
{
encoder << resourceRequest.url().string();
encoder << resourceRequest.httpMethod();
encoder << resourceRequest.httpHeaderFields();
encoder << resourceRequest.timeoutInterval();
// FIXME: Do not encode HTTP message body.
// 1. It can be large and thus costly to send across.
// 2. It is misleading to provide a body with some requests, while others use body streams, which cannot be serialized at all.
FormData* httpBody = resourceRequest.httpBody();
encoder << static_cast<bool>(httpBody);
if (httpBody)
encoder << httpBody->flattenToString();
encoder << resourceRequest.firstPartyForCookies().string();
encoder << resourceRequest.allowCookies();
encoder.encodeEnum(resourceRequest.priority());
encoder.encodeEnum(resourceRequest.cachePolicy());
encoder.encodeEnum(resourceRequest.requester());
encoder << static_cast<uint32_t>(resourceRequest.soupMessageFlags());
encoder << resourceRequest.initiatingPageID();
}
示例9: encodeImage
void ArgumentCoder<Cursor>::encode(ArgumentEncoder& encoder, const Cursor& cursor)
{
encoder.encodeEnum(cursor.type());
if (cursor.type() != Cursor::Custom)
return;
if (cursor.image()->isNull()) {
encoder << false; // There is no valid image being encoded.
return;
}
encoder << true;
encodeImage(encoder, cursor.image());
encoder << cursor.hotSpot();
}
示例10: adoptGRef
void ArgumentCoder<CertificateInfo>::encode(ArgumentEncoder& encoder, const CertificateInfo& certificateInfo)
{
if (!certificateInfo.certificate()) {
encoder << false;
return;
}
GByteArray* certificateData = 0;
g_object_get(G_OBJECT(certificateInfo.certificate()), "certificate", &certificateData, NULL);
if (!certificateData) {
encoder << false;
return;
}
encoder << true;
GRefPtr<GByteArray> certificate = adoptGRef(certificateData);
encoder.encodeVariableLengthByteArray(IPC::DataReference(certificate->data, certificate->len));
encoder << static_cast<uint32_t>(certificateInfo.tlsErrors());
}
示例11: switch
void ArgumentCoder<WebCore::FilterOperations>::encode(ArgumentEncoder& encoder, const WebCore::FilterOperations& filters)
{
encoder << static_cast<uint32_t>(filters.size());
for (size_t i = 0; i < filters.size(); ++i) {
const FilterOperation& filter = *filters.at(i);
FilterOperation::OperationType type = filter.type();
encoder.encodeEnum(type);
switch (type) {
case FilterOperation::GRAYSCALE:
case FilterOperation::SEPIA:
case FilterOperation::SATURATE:
case FilterOperation::HUE_ROTATE:
encoder << static_cast<double>(downcast<BasicColorMatrixFilterOperation>(filter).amount());
break;
case FilterOperation::INVERT:
case FilterOperation::BRIGHTNESS:
case FilterOperation::CONTRAST:
case FilterOperation::OPACITY:
encoder << static_cast<double>(downcast<BasicComponentTransferFilterOperation>(filter).amount());
break;
case FilterOperation::BLUR:
ArgumentCoder<Length>::encode(encoder, downcast<BlurFilterOperation>(filter).stdDeviation());
break;
case FilterOperation::DROP_SHADOW: {
const DropShadowFilterOperation& shadow = downcast<DropShadowFilterOperation>(filter);
ArgumentCoder<IntPoint>::encode(encoder, shadow.location());
encoder << static_cast<int32_t>(shadow.stdDeviation());
ArgumentCoder<Color>::encode(encoder, shadow.color());
break;
}
case FilterOperation::REFERENCE:
case FilterOperation::PASSTHROUGH:
case FilterOperation::DEFAULT:
case FilterOperation::NONE:
break;
}
}
}
示例12: encode
void DataReference::encode(ArgumentEncoder& encoder) const
{
encoder.encodeVariableLengthByteArray(*this);
}
示例13: encode
void Attachment::encode(ArgumentEncoder& encoder) const
{
encoder.addAttachment(*this);
}