本文整理汇总了C++中ArgumentDecoder类的典型用法代码示例。如果您正苦于以下问题:C++ ArgumentDecoder类的具体用法?C++ ArgumentDecoder怎么用?C++ ArgumentDecoder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ArgumentDecoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decodeGKeyFile
static bool decodeGKeyFile(ArgumentDecoder& decoder, GOwnPtr<GKeyFile>& keyFile)
{
DataReference dataReference;
if (!decoder.decode(dataReference))
return false;
if (!dataReference.size())
return true;
keyFile.set(g_key_file_new());
if (!g_key_file_load_from_data(keyFile.get(), reinterpret_cast<const gchar*>(dataReference.data()), dataReference.size(), G_KEY_FILE_NONE, 0)) {
keyFile.clear();
return false;
}
return true;
}
示例2:
bool ArgumentCoder<Cookie>::decode(ArgumentDecoder& decoder, Cookie& cookie)
{
if (!decoder.decode(cookie.name))
return false;
if (!decoder.decode(cookie.value))
return false;
if (!decoder.decode(cookie.domain))
return false;
if (!decoder.decode(cookie.path))
return false;
if (!decoder.decode(cookie.expires))
return false;
if (!decoder.decode(cookie.httpOnly))
return false;
if (!decoder.decode(cookie.secure))
return false;
if (!decoder.decode(cookie.session))
return false;
return true;
}
示例3: decodePlatformData
bool ArgumentCoder<ResourceError>::decode(ArgumentDecoder& decoder, ResourceError& resourceError)
{
if (kShouldSerializeWebCoreData) {
bool errorIsNull;
if (!decoder.decode(errorIsNull))
return false;
if (errorIsNull) {
resourceError = ResourceError();
return true;
}
String domain;
if (!decoder.decode(domain))
return false;
int errorCode;
if (!decoder.decode(errorCode))
return false;
String failingURL;
if (!decoder.decode(failingURL))
return false;
String localizedDescription;
if (!decoder.decode(localizedDescription))
return false;
bool isCancellation;
if (!decoder.decode(isCancellation))
return false;
bool isTimeout;
if (!decoder.decode(isTimeout))
return false;
resourceError = ResourceError(domain, errorCode, failingURL, localizedDescription);
resourceError.setIsCancellation(isCancellation);
resourceError.setIsTimeout(isTimeout);
}
return decodePlatformData(decoder, resourceError);
}
示例4: decodeImage
static bool decodeImage(ArgumentDecoder& decoder, GRefPtr<GdkPixbuf>& pixbuf)
{
ShareableBitmap::Handle handle;
if (!decoder.decode(handle))
return false;
RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(handle);
if (!bitmap)
return false;
RefPtr<Image> image = bitmap->createImage();
if (!image)
return false;
RefPtr<cairo_surface_t> surface = image->nativeImageForCurrentFrame();
if (!surface)
return false;
pixbuf = adoptGRef(gdk_pixbuf_get_from_surface(surface.get(), 0, 0, cairo_image_surface_get_width(surface.get()), cairo_image_surface_get_height(surface.get())));
if (!pixbuf)
return false;
return true;
}
示例5: CustomFilterProgramInfo
bool ArgumentCoder<WebCore::CustomFilterProgramInfo>::decode(ArgumentDecoder& decoder, CustomFilterProgramInfo& programInfo)
{
String vertexShaderString;
String fragmentShaderString;
CustomFilterProgramType programType;
CustomFilterMeshType meshType;
CustomFilterProgramMixSettings mixSettings;
if (!decoder.decode(vertexShaderString))
return false;
if (!decoder.decode(fragmentShaderString))
return false;
if (!decoder.decodeEnum(programType))
return false;
if (!decoder.decodeEnum(meshType))
return false;
if (!decoder.decodeEnum(mixSettings.blendMode))
return false;
if (!decoder.decodeEnum(mixSettings.compositeOperator))
return false;
programInfo = CustomFilterProgramInfo(vertexShaderString, fragmentShaderString, programType, mixSettings, meshType);
return true;
}
示例6:
bool ArgumentCoder<GraphicsLayerAnimations>::decode(ArgumentDecoder& decoder, GraphicsLayerAnimations& animations)
{
return decoder.decode(animations.animations());
}
示例7: keyframes
bool ArgumentCoder<GraphicsLayerAnimation>::decode(ArgumentDecoder& decoder, GraphicsLayerAnimation& animation)
{
String name;
IntSize boxSize;
GraphicsLayerAnimation::AnimationState state;
double startTime;
double pauseTime;
bool listsMatch;
Animation::AnimationDirection direction;
unsigned fillMode;
double duration;
double iterationCount;
RefPtr<TimingFunction> timingFunction;
RefPtr<Animation> animationObject;
if (!decoder.decode(name))
return false;
if (!decoder.decode(boxSize))
return false;
if (!decoder.decodeEnum(state))
return false;
if (!decoder.decode(startTime))
return false;
if (!decoder.decode(pauseTime))
return false;
if (!decoder.decode(listsMatch))
return false;
if (!decoder.decodeEnum(direction))
return false;
if (!decoder.decode(fillMode))
return false;
if (!decoder.decode(duration))
return false;
if (!decoder.decode(iterationCount))
return false;
if (!decodeTimingFunction(decoder, timingFunction))
return false;
animationObject = Animation::create();
animationObject->setDirection(direction);
animationObject->setFillMode(fillMode);
animationObject->setDuration(duration);
animationObject->setIterationCount(iterationCount);
if (timingFunction)
animationObject->setTimingFunction(timingFunction);
AnimatedPropertyID property;
if (!decoder.decodeEnum(property))
return false;
KeyframeValueList keyframes(property);
unsigned keyframesSize;
if (!decoder.decode(keyframesSize))
return false;
for (unsigned i = 0; i < keyframesSize; ++i) {
double keyTime;
RefPtr<TimingFunction> timingFunction;
if (!decoder.decode(keyTime))
return false;
if (!decodeTimingFunction(decoder, timingFunction))
return false;
switch (property) {
case AnimatedPropertyOpacity: {
float value;
if (!decoder.decode(value))
return false;
keyframes.insert(FloatAnimationValue::create(keyTime, value, timingFunction.get()));
break;
}
case AnimatedPropertyWebkitTransform: {
TransformOperations transform;
if (!decoder.decode(transform))
return false;
keyframes.insert(TransformAnimationValue::create(keyTime, transform, timingFunction.get()));
break;
}
case AnimatedPropertyWebkitFilter: {
FilterOperations filter;
if (!decoder.decode(filter))
return false;
keyframes.insert(FilterAnimationValue::create(keyTime, filter, timingFunction.get()));
break;
}
default:
break;
}
}
animation = GraphicsLayerAnimation(name, keyframes, boxSize, animationObject.get(), startTime, listsMatch);
animation.setState(state, pauseTime);
return true;
}
示例8: switch
bool ArgumentCoder<TransformOperations>::decode(ArgumentDecoder& decoder, TransformOperations& transformOperations)
{
uint32_t operationsSize;
if (!decoder.decode(operationsSize))
return false;
for (size_t i = 0; i < operationsSize; ++i) {
TransformOperation::OperationType operationType;
if (!decoder.decodeEnum(operationType))
return false;
switch (operationType) {
case TransformOperation::SCALE_X:
case TransformOperation::SCALE_Y:
case TransformOperation::SCALE:
case TransformOperation::SCALE_Z:
case TransformOperation::SCALE_3D: {
double x, y, z;
if (!decoder.decode(x))
return false;
if (!decoder.decode(y))
return false;
if (!decoder.decode(z))
return false;
transformOperations.operations().append(ScaleTransformOperation::create(x, y, z, operationType));
break;
}
case TransformOperation::TRANSLATE_X:
case TransformOperation::TRANSLATE_Y:
case TransformOperation::TRANSLATE:
case TransformOperation::TRANSLATE_Z:
case TransformOperation::TRANSLATE_3D: {
Length x, y, z;
if (!ArgumentCoder<Length>::decode(decoder, x))
return false;
if (!ArgumentCoder<Length>::decode(decoder, y))
return false;
if (!ArgumentCoder<Length>::decode(decoder, z))
return false;
transformOperations.operations().append(TranslateTransformOperation::create(x, y, z, operationType));
break;
}
case TransformOperation::ROTATE:
case TransformOperation::ROTATE_X:
case TransformOperation::ROTATE_Y:
case TransformOperation::ROTATE_3D: {
double x, y, z, angle;
if (!decoder.decode(x))
return false;
if (!decoder.decode(y))
return false;
if (!decoder.decode(z))
return false;
if (!decoder.decode(angle))
return false;
transformOperations.operations().append(RotateTransformOperation::create(x, y, z, angle, operationType));
break;
}
case TransformOperation::SKEW_X:
case TransformOperation::SKEW_Y:
case TransformOperation::SKEW: {
double angleX, angleY;
if (!decoder.decode(angleX))
return false;
if (!decoder.decode(angleY))
return false;
transformOperations.operations().append(SkewTransformOperation::create(angleX, angleY, operationType));
break;
}
case TransformOperation::MATRIX: {
TransformationMatrix matrix;
if (!ArgumentCoder<TransformationMatrix>::decode(decoder, matrix))
return false;
transformOperations.operations().append(MatrixTransformOperation::create(matrix));
break;
}
case TransformOperation::MATRIX_3D: {
TransformationMatrix matrix;
if (!ArgumentCoder<TransformationMatrix>::decode(decoder, matrix))
return false;
transformOperations.operations().append(Matrix3DTransformOperation::create(matrix));
break;
}
case TransformOperation::PERSPECTIVE: {
Length perspective;
if (!ArgumentCoder<Length>::decode(decoder, perspective))
return false;
transformOperations.operations().append(PerspectiveTransformOperation::create(perspective));
break;
}
case TransformOperation::IDENTITY:
transformOperations.operations().append(IdentityTransformOperation::create());
break;
case TransformOperation::NONE:
ASSERT_NOT_REACHED();
break;
}
}
return true;
}
示例9:
bool ArgumentCoder<ResourceRequest>::decodePlatformData(ArgumentDecoder& decoder, ResourceRequest& resourceRequest)
{
String url;
if (!decoder.decode(url))
return false;
resourceRequest.setURL(URL(URL(), url));
String httpMethod;
if (!decoder.decode(httpMethod))
return false;
resourceRequest.setHTTPMethod(httpMethod);
HTTPHeaderMap headers;
if (!decoder.decode(headers))
return false;
resourceRequest.setHTTPHeaderFields(WTF::move(headers));
double timeoutInterval;
if (!decoder.decode(timeoutInterval))
return false;
resourceRequest.setTimeoutInterval(timeoutInterval);
bool hasHTTPBody;
if (!decoder.decode(hasHTTPBody))
return false;
if (hasHTTPBody) {
String httpBody;
if (!decoder.decode(httpBody))
return false;
resourceRequest.setHTTPBody(FormData::create(httpBody.utf8()));
}
String firstPartyForCookies;
if (!decoder.decode(firstPartyForCookies))
return false;
resourceRequest.setFirstPartyForCookies(URL(URL(), firstPartyForCookies));
bool allowCookies;
if (!decoder.decode(allowCookies))
return false;
resourceRequest.setAllowCookies(allowCookies);
ResourceLoadPriority priority;
if (!decoder.decodeEnum(priority))
return false;
resourceRequest.setPriority(priority);
ResourceRequestCachePolicy cachePolicy;
if (!decoder.decodeEnum(cachePolicy))
return false;
resourceRequest.setCachePolicy(cachePolicy);
ResourceRequest::Requester requester;
if (!decoder.decodeEnum(requester))
return false;
resourceRequest.setRequester(requester);
uint32_t soupMessageFlags;
if (!decoder.decode(soupMessageFlags))
return false;
resourceRequest.setSoupMessageFlags(static_cast<SoupMessageFlags>(soupMessageFlags));
uint64_t initiatingPageID;
if (!decoder.decode(initiatingPageID))
return false;
resourceRequest.setInitiatingPageID(initiatingPageID);
return true;
}
示例10: decodeDataObject
static bool decodeDataObject(ArgumentDecoder& decoder, RefPtr<DataObjectGtk>& dataObject)
{
RefPtr<DataObjectGtk> data = DataObjectGtk::create();
bool hasText;
if (!decoder.decode(hasText))
return false;
if (hasText) {
String text;
if (!decoder.decode(text))
return false;
data->setText(text);
}
bool hasMarkup;
if (!decoder.decode(hasMarkup))
return false;
if (hasMarkup) {
String markup;
if (!decoder.decode(markup))
return false;
data->setMarkup(markup);
}
bool hasURL;
if (!decoder.decode(hasURL))
return false;
if (hasURL) {
String url;
if (!decoder.decode(url))
return false;
data->setURL(URL(URL(), url), String());
}
bool hasURIList;
if (!decoder.decode(hasURIList))
return false;
if (hasURIList) {
String uriList;
if (!decoder.decode(uriList))
return false;
data->setURIList(uriList);
}
bool hasImage;
if (!decoder.decode(hasImage))
return false;
if (hasImage) {
GRefPtr<GdkPixbuf> image;
if (!decodeImage(decoder, image))
return false;
data->setImage(image.get());
}
bool hasUnknownTypeData;
if (!decoder.decode(hasUnknownTypeData))
return false;
if (hasUnknownTypeData) {
HashMap<String, String> unknownTypes;
if (!decoder.decode(unknownTypes))
return false;
auto end = unknownTypes.end();
for (auto it = unknownTypes.begin(); it != end; ++it)
data->setUnknownTypeData(it->key, it->value);
}
dataObject = data;
return true;
}
示例11: PLATFORM
bool ArgumentCoder<ResourceResponse>::decode(ArgumentDecoder& decoder, ResourceResponse& resourceResponse)
{
#if PLATFORM(MAC)
bool hasSerializedWebCoreData;
if (!decoder.decode(hasSerializedWebCoreData))
return false;
#else
bool hasSerializedWebCoreData = true;
#endif
ResourceResponse response;
if (!decodePlatformData(decoder, response))
return false;
if (hasSerializedWebCoreData) {
bool responseIsNull;
if (!decoder.decode(responseIsNull))
return false;
if (responseIsNull) {
resourceResponse = ResourceResponse();
return true;
}
String url;
if (!decoder.decode(url))
return false;
response.setURL(KURL(KURL(), url));
int32_t httpStatusCode;
if (!decoder.decode(httpStatusCode))
return false;
response.setHTTPStatusCode(httpStatusCode);
HTTPHeaderMap headers;
if (!decoder.decode(headers))
return false;
for (HTTPHeaderMap::const_iterator it = headers.begin(), end = headers.end(); it != end; ++it)
response.setHTTPHeaderField(it->key, it->value);
String mimeType;
if (!decoder.decode(mimeType))
return false;
response.setMimeType(mimeType);
String textEncodingName;
if (!decoder.decode(textEncodingName))
return false;
response.setTextEncodingName(textEncodingName);
int64_t contentLength;
if (!decoder.decode(contentLength))
return false;
response.setExpectedContentLength(contentLength);
String httpStatusText;
if (!decoder.decode(httpStatusText))
return false;
response.setHTTPStatusText(httpStatusText);
String suggestedFilename;
if (!decoder.decode(suggestedFilename))
return false;
response.setSuggestedFilename(suggestedFilename);
}
resourceResponse = response;
return true;
}
示例12: decode
bool DataReference::decode(ArgumentDecoder& decoder, DataReference& dataReference)
{
return decoder.decodeVariableLengthByteArray(dataReference);
}
示例13: USE
bool ArgumentCoder<CoordinatedGraphicsLayerState>::decode(ArgumentDecoder& decoder, CoordinatedGraphicsLayerState& state)
{
if (!decoder.decode(state.changeMask))
return false;
if (state.flagsChanged && !decoder.decode(state.flags))
return false;
if (state.positionChanged && !decoder.decode(state.pos))
return false;
if (state.anchorPointChanged && !decoder.decode(state.anchorPoint))
return false;
if (state.sizeChanged && !decoder.decode(state.size))
return false;
if (state.transformChanged && !decoder.decode(state.transform))
return false;
if (state.childrenTransformChanged && !decoder.decode(state.childrenTransform))
return false;
if (state.contentsRectChanged && !decoder.decode(state.contentsRect))
return false;
if (state.contentsTilingChanged) {
if (!decoder.decode(state.contentsTileSize))
return false;
if (!decoder.decode(state.contentsTilePhase))
return false;
}
if (state.opacityChanged && !decoder.decode(state.opacity))
return false;
if (state.solidColorChanged && !decoder.decode(state.solidColor))
return false;
if (state.debugBorderColorChanged && !decoder.decode(state.debugBorderColor))
return false;
if (state.debugBorderWidthChanged && !decoder.decode(state.debugBorderWidth))
return false;
if (state.filtersChanged && !decoder.decode(state.filters))
return false;
if (state.animationsChanged && !decoder.decode(state.animations))
return false;
if (state.childrenChanged && !decoder.decode(state.children))
return false;
if (!decoder.decode(state.tilesToCreate))
return false;
if (!decoder.decode(state.tilesToRemove))
return false;
if (state.replicaChanged && !decoder.decode(state.replica))
return false;
if (state.maskChanged && !decoder.decode(state.mask))
return false;
if (state.imageChanged && !decoder.decode(state.imageID))
return false;
if (state.repaintCountChanged && !decoder.decode(state.repaintCount))
return false;
if (!decoder.decode(state.tilesToUpdate))
return false;
#if USE(GRAPHICS_SURFACE)
if (state.platformLayerChanged) {
if (!decoder.decode(state.platformLayerSize))
return false;
if (!decoder.decode(state.platformLayerToken))
return false;
if (!decoder.decode(state.platformLayerFrontBuffer))
return false;
if (!decoder.decode(state.platformLayerSurfaceFlags))
return false;
}
#endif
if (state.committedScrollOffsetChanged && !decoder.decode(state.committedScrollOffset))
return false;
return true;
}
示例14: decode
bool Attachment::decode(ArgumentDecoder& decoder, Attachment& attachment)
{
if (!decoder.removeAttachment(attachment))
return false;
return true;
}
示例15: parameters
bool ArgumentCoder<WebCore::FilterOperations>::decode(ArgumentDecoder& decoder, WebCore::FilterOperations& filters)
{
uint32_t size;
if (!decoder.decode(size))
return false;
Vector<RefPtr<FilterOperation> >& operations = filters.operations();
for (size_t i = 0; i < size; ++i) {
FilterOperation::OperationType type;
RefPtr<FilterOperation> filter;
if (!decoder.decodeEnum(type))
return false;
switch (type) {
case FilterOperation::GRAYSCALE:
case FilterOperation::SEPIA:
case FilterOperation::SATURATE:
case FilterOperation::HUE_ROTATE: {
double value;
if (!decoder.decode(value))
return false;
filter = BasicColorMatrixFilterOperation::create(value, type);
break;
}
case FilterOperation::INVERT:
case FilterOperation::BRIGHTNESS:
case FilterOperation::CONTRAST:
case FilterOperation::OPACITY: {
double value;
if (!decoder.decode(value))
return false;
filter = BasicComponentTransferFilterOperation::create(value, type);
break;
}
case FilterOperation::BLUR: {
Length length;
if (!ArgumentCoder<Length>::decode(decoder, length))
return false;
filter = BlurFilterOperation::create(length, type);
break;
}
case FilterOperation::DROP_SHADOW: {
IntPoint location;
int32_t stdDeviation;
Color color;
if (!ArgumentCoder<IntPoint>::decode(decoder, location))
return false;
if (!decoder.decode(stdDeviation))
return false;
if (!ArgumentCoder<Color>::decode(decoder, color))
return false;
filter = DropShadowFilterOperation::create(location, stdDeviation, color, type);
break;
}
#if ENABLE(CSS_SHADERS)
case FilterOperation::CUSTOM:
// Custom Filters are converted to VALIDATED_CUSTOM before reaching this point.
ASSERT_NOT_REACHED();
break;
case FilterOperation::VALIDATED_CUSTOM: {
// FIXME: CustomFilterOperation should not need the meshType.
// https://bugs.webkit.org/show_bug.cgi?id=102529
CustomFilterMeshType meshType;
if (!decoder.decodeEnum(meshType))
return false;
int programID = 0;
if (!decoder.decode(programID))
return false;
uint32_t parametersSize;
if (!decoder.decode(parametersSize))
return false;
CustomFilterParameterList parameters(parametersSize);
for (size_t i = 0; i < parametersSize; ++i) {
String name;
CustomFilterParameter::ParameterType parameterType;
if (!decoder.decode(name))
return false;
if (!decoder.decodeEnum(parameterType))
return false;
switch (parameterType) {
case CustomFilterParameter::ARRAY: {
RefPtr<CustomFilterArrayParameter> arrayParameter = CustomFilterArrayParameter::create(name);
uint32_t arrayParameterSize;
if (!decoder.decode(arrayParameterSize))
return false;
double arrayParameterValue;
for (size_t j = 0; j < arrayParameterSize; ++j) {
if (!decoder.decode(arrayParameterValue))
return false;
arrayParameter->addValue(arrayParameterValue);
}
parameters[i] = arrayParameter.release();
break;
}
case CustomFilterParameter::NUMBER: {
RefPtr<CustomFilterNumberParameter> numberParameter = CustomFilterNumberParameter::create(name);
//.........这里部分代码省略.........