summaryrefslogtreecommitdiff
path: root/Source/WebKit2/Shared
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-06-01 10:36:58 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-06-01 10:36:58 +0200
commitb1e9e47fa11f608ae16bc07f97a2acf95bf80272 (patch)
treec88c45e80c9c44506e7cdf9a3bb39ebf82a8cd5b /Source/WebKit2/Shared
parentbe01689f43cf6882cf670d33df49ead1f570c53a (diff)
downloadqtwebkit-b1e9e47fa11f608ae16bc07f97a2acf95bf80272.tar.gz
Imported WebKit commit 499c84c99aa98e9870fa7eaa57db476c6d160d46 (http://svn.webkit.org/repository/webkit/trunk@119200)
Weekly update :). Particularly relevant changes for Qt are the use of the WebCore image decoders and direct usage of libpng/libjpeg if available in the system.
Diffstat (limited to 'Source/WebKit2/Shared')
-rwxr-xr-xSource/WebKit2/Shared/API/c/efl/WKURLRequestEfl.cpp32
-rwxr-xr-xSource/WebKit2/Shared/API/c/efl/WKURLRequestEfl.h35
-rwxr-xr-xSource/WebKit2/Shared/API/c/efl/WKURLResponseEfl.cpp32
-rwxr-xr-xSource/WebKit2/Shared/API/c/efl/WKURLResponseEfl.h35
-rw-r--r--Source/WebKit2/Shared/WebCoreArgumentCoders.cpp594
-rw-r--r--Source/WebKit2/Shared/WebCoreArgumentCoders.h68
-rwxr-xr-xSource/WebKit2/Shared/efl/WebCoreArgumentCodersEfl.cpp105
-rwxr-xr-xSource/WebKit2/Shared/efl/WebURLRequestEfl.cpp40
-rwxr-xr-xSource/WebKit2/Shared/efl/WebURLRequestEfl.h46
-rwxr-xr-xSource/WebKit2/Shared/efl/WebURLResponseEfl.cpp38
-rwxr-xr-xSource/WebKit2/Shared/efl/WebURLResponseEfl.h46
11 files changed, 418 insertions, 653 deletions
diff --git a/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.cpp b/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.cpp
new file mode 100755
index 000000000..9a3e9fcc5
--- /dev/null
+++ b/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WKURLRequestEfl.h"
+
+#include "WKAPICast.h"
+#include "WebURLRequestEfl.h"
+
+using namespace WebKit;
+
+WKStringRef WKURLRequestEflCopyCookies(WKURLRequestRef requestRef)
+{
+ RefPtr<WebURLRequestEfl> requestEfl = WebURLRequestEfl::create(toImpl(requestRef));
+ return toCopiedAPI(requestEfl->cookies());
+}
diff --git a/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.h b/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.h
new file mode 100755
index 000000000..62688dd54
--- /dev/null
+++ b/Source/WebKit2/Shared/API/c/efl/WKURLRequestEfl.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WKURLRequestEfl_h
+#define WKURLRequestEfl_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKStringRef WKURLRequestEflCopyCookies(WKURLRequestRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKURLRequestEfl_h */
diff --git a/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.cpp b/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.cpp
new file mode 100755
index 000000000..abe01d77b
--- /dev/null
+++ b/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WKURLResponseEfl.h"
+
+#include "WKAPICast.h"
+#include "WebURLResponseEfl.h"
+
+using namespace WebKit;
+
+WKStringRef WKURLResponseEflCopyContentType(WKURLResponseRef responseRef)
+{
+ RefPtr<WebURLResponseEfl> responseEfl = WebURLResponseEfl::create(toImpl(responseRef));
+ return toCopiedAPI(responseEfl->contentType());
+}
diff --git a/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.h b/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.h
new file mode 100755
index 000000000..bae655c64
--- /dev/null
+++ b/Source/WebKit2/Shared/API/c/efl/WKURLResponseEfl.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WKURLResponseEfl_h
+#define WKURLResponseEfl_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKStringRef WKURLResponseEflCopyContentType(WKURLResponseRef);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKURLResponseEfl_h */
diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
index 804568c2d..3cb57b013 100644
--- a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
+++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp
@@ -45,25 +45,15 @@
#include <WebCore/WindowFeatures.h>
#include <wtf/text/StringHash.h>
-#if PLATFORM(QT)
+#if USE(UI_SIDE_COMPOSITING)
#include <WebCore/Animation.h>
#include <WebCore/FloatPoint3D.h>
-#include <WebCore/IdentityTransformOperation.h>
-#include <WebCore/Matrix3DTransformOperation.h>
-#include <WebCore/MatrixTransformOperation.h>
-#include <WebCore/PerspectiveTransformOperation.h>
-#include <WebCore/RotateTransformOperation.h>
-#include <WebCore/ScaleTransformOperation.h>
-#include <WebCore/SkewTransformOperation.h>
-#include <WebCore/TimingFunction.h>
-#include <WebCore/TransformOperation.h>
-#include <WebCore/TransformOperations.h>
-#include <WebCore/TranslateTransformOperation.h>
-#endif
+#include <WebCore/TransformationMatrix.h>
-#if USE(UI_SIDE_COMPOSITING) && ENABLE(CSS_FILTERS)
+#if ENABLE(CSS_FILTERS)
#include <WebCore/FilterOperations.h>
#endif
+#endif
using namespace WebCore;
using namespace WebKit;
@@ -642,8 +632,7 @@ bool ArgumentCoder<KURL>::decode(ArgumentDecoder* decoder, KURL& result)
return true;
}
-#if PLATFORM(QT)
-
+#if USE(UI_SIDE_COMPOSITING)
void ArgumentCoder<FloatPoint3D>::encode(ArgumentEncoder* encoder, const FloatPoint3D& floatPoint3D)
{
SimpleArgumentCoder<FloatPoint3D>::encode(encoder, floatPoint3D);
@@ -654,7 +643,6 @@ bool ArgumentCoder<FloatPoint3D>::decode(ArgumentDecoder* decoder, FloatPoint3D&
return SimpleArgumentCoder<FloatPoint3D>::decode(decoder, floatPoint3D);
}
-
void ArgumentCoder<Length>::encode(ArgumentEncoder* encoder, const Length& length)
{
SimpleArgumentCoder<Length>::encode(encoder, length);
@@ -675,577 +663,7 @@ bool ArgumentCoder<TransformationMatrix>::decode(ArgumentDecoder* decoder, Trans
return SimpleArgumentCoder<TransformationMatrix>::decode(decoder, transformationMatrix);
}
-
-void ArgumentCoder<RefPtr<MatrixTransformOperation> >::encode(ArgumentEncoder* encoder, const MatrixTransformOperation* operation)
-{
- ArgumentCoder<WebCore::TransformationMatrix>::encode(encoder, operation->matrix());
-}
-
-bool ArgumentCoder<RefPtr<MatrixTransformOperation> >::decode(ArgumentDecoder* decoder, RefPtr<MatrixTransformOperation>& operation)
-{
- TransformationMatrix matrix;
- if (!ArgumentCoder<WebCore::TransformationMatrix>::decode(decoder, matrix))
- return false;
-
- operation = MatrixTransformOperation::create(matrix);
- return true;
-}
-
-void ArgumentCoder<RefPtr<Matrix3DTransformOperation> >::encode(ArgumentEncoder* encoder, const Matrix3DTransformOperation* operation)
-{
- ArgumentCoder<TransformationMatrix>::encode(encoder, operation->matrix());
-}
-
-bool ArgumentCoder<RefPtr<Matrix3DTransformOperation> >::decode(ArgumentDecoder* decoder, RefPtr<Matrix3DTransformOperation>& operation)
-{
-
- TransformationMatrix matrix;
- if (!ArgumentCoder<WebCore::TransformationMatrix>::decode(decoder, matrix))
- return false;
-
- operation = Matrix3DTransformOperation::create(matrix);
- return true;
-}
-
-void ArgumentCoder<RefPtr<PerspectiveTransformOperation> >::encode(ArgumentEncoder* encoder, const PerspectiveTransformOperation* operation)
-{
- ArgumentCoder<Length>::encode(encoder, operation->perspective());
-}
-
-bool ArgumentCoder<RefPtr<PerspectiveTransformOperation> >::decode(ArgumentDecoder* decoder, RefPtr<PerspectiveTransformOperation>& operation)
-{
- Length perspective;
- if (!ArgumentCoder<Length>::decode(decoder, perspective))
- return false;
-
- operation = PerspectiveTransformOperation::create(perspective);
- return true;
-}
-
-void ArgumentCoder<RefPtr<RotateTransformOperation> >::encode(ArgumentEncoder* encoder, const RotateTransformOperation* operation)
-{
- const TransformOperation* transformOperation = operation;
- encoder->encodeEnum(transformOperation->getOperationType());
- encoder->encode(operation->x());
- encoder->encode(operation->y());
- encoder->encode(operation->z());
- encoder->encode(operation->angle());
-}
-
-bool ArgumentCoder<RefPtr<RotateTransformOperation> >::decode(ArgumentDecoder* decoder, RefPtr<RotateTransformOperation>& operation)
-{
- TransformOperation::OperationType operationType;
- double x;
- double y;
- double z;
- double angle;
-
- if (!decoder->decodeEnum(operationType))
- return false;
- if (!decoder->decode(x))
- return false;
- if (!decoder->decode(y))
- return false;
- if (!decoder->decode(z))
- return false;
- if (!decoder->decode(angle))
- return false;
-
- operation = RotateTransformOperation::create(x, y, z, angle, operationType);
- return true;
-}
-
-
-void ArgumentCoder<RefPtr<ScaleTransformOperation> >::encode(ArgumentEncoder* encoder, const ScaleTransformOperation* operation)
-{
- const TransformOperation* transformOperation = operation;
- encoder->encodeEnum(transformOperation->getOperationType());
- encoder->encode(operation->x());
- encoder->encode(operation->y());
- encoder->encode(operation->z());
-}
-
-bool ArgumentCoder<RefPtr<ScaleTransformOperation> >::decode(ArgumentDecoder* decoder, RefPtr<ScaleTransformOperation>& operation)
-{
- TransformOperation::OperationType operationType;
- double x;
- double y;
- double z;
-
- if (!decoder->decodeEnum(operationType))
- return false;
- if (!decoder->decode(x))
- return false;
- if (!decoder->decode(y))
- return false;
- if (!decoder->decode(z))
- return false;
-
- operation = ScaleTransformOperation::create(x, y, z, operationType);
- return true;
-}
-
-void ArgumentCoder<RefPtr<SkewTransformOperation> >::encode(ArgumentEncoder* encoder, const SkewTransformOperation* operation)
-{
- const TransformOperation* transformOperation = operation;
- encoder->encodeEnum(transformOperation->getOperationType());
- encoder->encode(operation->angleX());
- encoder->encode(operation->angleY());
-}
-
-bool ArgumentCoder<RefPtr<SkewTransformOperation> >::decode(ArgumentDecoder* decoder, RefPtr<SkewTransformOperation>& operation)
-{
- TransformOperation::OperationType operationType;
- double angleX;
- double angleY;
-
- if (!decoder->decodeEnum(operationType))
- return false;
- if (!decoder->decode(angleX))
- return false;
- if (!decoder->decode(angleY))
- return false;
-
- operation = SkewTransformOperation::create(angleX, angleY, operationType);
- return true;
-}
-
-void ArgumentCoder<RefPtr<TranslateTransformOperation> >::encode(ArgumentEncoder* encoder, const TranslateTransformOperation* operation)
-{
- const TransformOperation* transformOperation = operation;
- encoder->encodeEnum(transformOperation->getOperationType());
- ArgumentCoder<Length>::encode(encoder, operation->x());
- ArgumentCoder<Length>::encode(encoder, operation->y());
- ArgumentCoder<Length>::encode(encoder, operation->z());
-}
-
-bool ArgumentCoder<RefPtr<TranslateTransformOperation> >::decode(ArgumentDecoder* decoder, RefPtr<TranslateTransformOperation>& operation)
-{
- TransformOperation::OperationType operationType;
- Length x;
- Length y;
- Length z;
-
- if (!decoder->decodeEnum(operationType))
- return false;
- if (!ArgumentCoder<Length>::decode(decoder, x))
- return false;
- if (!ArgumentCoder<Length>::decode(decoder, y))
- return false;
- if (!ArgumentCoder<Length>::decode(decoder, z))
- return false;
-
- operation = TranslateTransformOperation::create(x, y, z, operationType);
- return true;
-}
-
-void ArgumentCoder<RefPtr<TimingFunction> >::encode(ArgumentEncoder* encoder, const RefPtr<TimingFunction>& function)
-{
- encode(encoder, function.get());
-}
-
-void ArgumentCoder<RefPtr<TimingFunction> >::encode(ArgumentEncoder* encoder, const WebCore::TimingFunction* function)
-{
- if (!function) {
- encoder->encodeEnum(WebCore::TimingFunction::LinearFunction);
- return;
- }
-
- encoder->encodeEnum(function->type());
- switch (function->type()) {
- case TimingFunction::LinearFunction:
- break;
- case TimingFunction::CubicBezierFunction: {
- const WebCore::CubicBezierTimingFunction* cubicFunction = static_cast<const WebCore::CubicBezierTimingFunction*>(function);
- encoder->encodeDouble(cubicFunction->x1());
- encoder->encodeDouble(cubicFunction->y1());
- encoder->encodeDouble(cubicFunction->x2());
- encoder->encodeDouble(cubicFunction->y2());
- break;
- }
- case TimingFunction::StepsFunction: {
- const WebCore::StepsTimingFunction* stepsFunction = static_cast<const WebCore::StepsTimingFunction*>(function);
- encoder->encodeInt32(stepsFunction->numberOfSteps());
- encoder->encodeBool(stepsFunction->stepAtStart());
- break;
- }
- }
-}
-
-bool ArgumentCoder<RefPtr<TimingFunction> >::decode(ArgumentDecoder* decoder, RefPtr<TimingFunction>& function)
-{
- TimingFunction::TimingFunctionType type;
- if (!decoder->decodeEnum(type))
- return false;
-
- switch (type) {
- case TimingFunction::LinearFunction:
- function = LinearTimingFunction::create();
- return true;
-
- case TimingFunction::CubicBezierFunction: {
- double x1, y1, x2, y2;
- if (!decoder->decodeDouble(x1))
- return false;
- if (!decoder->decodeDouble(y1))
- return false;
- if (!decoder->decodeDouble(x2))
- return false;
- if (!decoder->decodeDouble(y2))
- return false;
- function = CubicBezierTimingFunction::create(x1, y1, x2, y2);
- return true;
- }
-
- case TimingFunction::StepsFunction: {
- int numSteps;
- bool stepAtStart;
- if (!decoder->decodeInt32(numSteps))
- return false;
- if (!decoder->decodeBool(stepAtStart))
- return false;
-
- function = StepsTimingFunction::create(numSteps, stepAtStart);
- return true;
- }
-
- }
-
- return false;
-}
-
-template<typename T>
-void encodeOperation(ArgumentEncoder* encoder, const RefPtr<TransformOperation>& operation)
-{
- ArgumentCoder<RefPtr<T> >::encode(encoder, static_cast<const T*>(operation.get()));
-}
-
-void ArgumentCoder<RefPtr<TransformOperation> >::encode(ArgumentEncoder* encoder, const RefPtr<TransformOperation>& operation)
-{
- // We don't want to encode null-references.
- ASSERT(operation);
-
- encoder->encodeEnum(operation->getOperationType());
- switch (operation->getOperationType()) {
- case TransformOperation::SCALE:
- case TransformOperation::SCALE_X:
- case TransformOperation::SCALE_Y:
- case TransformOperation::SCALE_Z:
- case TransformOperation::SCALE_3D:
- encodeOperation<ScaleTransformOperation>(encoder, operation);
- return;
-
- case TransformOperation::TRANSLATE:
- case TransformOperation::TRANSLATE_X:
- case TransformOperation::TRANSLATE_Y:
- case TransformOperation::TRANSLATE_Z:
- case TransformOperation::TRANSLATE_3D:
- encodeOperation<TranslateTransformOperation>(encoder, operation);
- return;
-
- case TransformOperation::ROTATE:
- case TransformOperation::ROTATE_X:
- case TransformOperation::ROTATE_Y:
- case TransformOperation::ROTATE_3D:
- encodeOperation<RotateTransformOperation>(encoder, operation);
- return;
-
- case TransformOperation::SKEW:
- case TransformOperation::SKEW_X:
- case TransformOperation::SKEW_Y:
- encodeOperation<SkewTransformOperation>(encoder, operation);
- return;
-
- case TransformOperation::MATRIX:
- encodeOperation<MatrixTransformOperation>(encoder, operation);
- return;
-
- case TransformOperation::MATRIX_3D:
- encodeOperation<Matrix3DTransformOperation>(encoder, operation);
- return;
-
- case TransformOperation::PERSPECTIVE:
- encodeOperation<PerspectiveTransformOperation>(encoder, operation);
- return;
-
- case TransformOperation::IDENTITY:
- case TransformOperation::NONE:
- return;
- }
-}
-
-template<typename T>
-bool decodeOperation(ArgumentDecoder* decoder, RefPtr<TransformOperation>& operation)
-{
- RefPtr<T> newOperation;
- if (!decoder->decode(newOperation))
- return false;
-
- operation = newOperation;
- return true;
-}
-
-bool ArgumentCoder<RefPtr<TransformOperation> >::decode(ArgumentDecoder* decoder, RefPtr<TransformOperation>& operation)
-{
- TransformOperation::OperationType type;
- if (!decoder->decodeEnum(type))
- return false;
-
- switch (type) {
- case TransformOperation::SCALE:
- case TransformOperation::SCALE_X:
- case TransformOperation::SCALE_Y:
- case TransformOperation::SCALE_Z:
- case TransformOperation::SCALE_3D:
- return decodeOperation<ScaleTransformOperation>(decoder, operation);
-
- case TransformOperation::TRANSLATE:
- case TransformOperation::TRANSLATE_X:
- case TransformOperation::TRANSLATE_Y:
- case TransformOperation::TRANSLATE_Z:
- case TransformOperation::TRANSLATE_3D:
- return decodeOperation<TranslateTransformOperation>(decoder, operation);
-
- case TransformOperation::ROTATE:
- case TransformOperation::ROTATE_X:
- case TransformOperation::ROTATE_Y:
- case TransformOperation::ROTATE_3D:
- return decodeOperation<RotateTransformOperation>(decoder, operation);
-
- case TransformOperation::SKEW:
- case TransformOperation::SKEW_X:
- case TransformOperation::SKEW_Y:
- return decodeOperation<SkewTransformOperation>(decoder, operation);
-
- case TransformOperation::MATRIX:
- return decodeOperation<MatrixTransformOperation>(decoder, operation);
-
- case TransformOperation::MATRIX_3D:
- return decodeOperation<Matrix3DTransformOperation>(decoder, operation);
-
- case TransformOperation::PERSPECTIVE:
- return decodeOperation<PerspectiveTransformOperation>(decoder, operation);
-
- case TransformOperation::IDENTITY:
- case TransformOperation::NONE:
- operation = IdentityTransformOperation::create();
- return true;
- }
-
- return false;
-}
-
-void ArgumentCoder<TransformOperations>::encode(ArgumentEncoder* encoder, const TransformOperations& operations)
-{
- Vector<RefPtr<TransformOperation> > operationsVector = operations.operations();
- int size = operationsVector.size();
- encoder->encodeInt32(size);
- for (int i = 0; i < size; ++i)
- ArgumentCoder<RefPtr<TransformOperation> >::encode(encoder, operationsVector[i]);
-}
-
-bool ArgumentCoder<TransformOperations>::decode(ArgumentDecoder* decoder, TransformOperations& operations)
-{
- int size;
- if (!decoder->decodeInt32(size))
- return false;
-
- Vector<RefPtr<TransformOperation> >& operationVector = operations.operations();
- operationVector.clear();
- operationVector.resize(size);
- for (int i = 0; i < size; ++i) {
- RefPtr<TransformOperation> operation;
- if (!ArgumentCoder<RefPtr<TransformOperation> >::decode(decoder, operation))
- return false;
- operationVector[i] = operation;
- }
-
- return true;
-}
-
-template<typename T>
-static void encodeBoolAndValue(ArgumentEncoder* encoder, bool isSet, const T& value)
-{
- encoder->encodeBool(isSet);
- if (isSet)
- encoder->encode(value);
-}
-
-template<typename T>
-static void encodeBoolAndEnumValue(ArgumentEncoder* encoder, bool isSet, T value)
-{
- encoder->encodeBool(isSet);
- if (isSet)
- encoder->encodeEnum(value);
-}
-
-void ArgumentCoder<RefPtr<Animation> >::encode(ArgumentEncoder* encoder, const RefPtr<Animation>& animation)
-{
- encodeBoolAndValue(encoder, animation->isDelaySet(), animation->delay());
- encodeBoolAndEnumValue(encoder, animation->isDirectionSet(), animation->direction());
- encodeBoolAndValue(encoder, animation->isDurationSet(), animation->duration());
- encodeBoolAndValue(encoder, animation->isFillModeSet(), animation->fillMode());
- encodeBoolAndValue(encoder, animation->isIterationCountSet(), animation->iterationCount());
- encodeBoolAndValue(encoder, animation->isNameSet(), animation->name());
- encodeBoolAndEnumValue(encoder, animation->isPlayStateSet(), animation->playState());
- encodeBoolAndValue(encoder, animation->isPropertySet(), static_cast<int>(animation->property()));
- encodeBoolAndValue<RefPtr<TimingFunction> >(encoder, animation->isTimingFunctionSet(), animation->timingFunction());
- encoder->encodeBool(animation->isNoneAnimation());
-}
-
-
-template<typename T>
-static bool decodeBoolAndValue(ArgumentDecoder* decoder, bool& isSet, T& value)
-{
- if (!decoder->decodeBool(isSet))
- return false;
- if (!isSet)
- return true;
-
- return decoder->decode(value);
-}
-
-template<typename T>
-static bool decodeBoolAndEnumValue(ArgumentDecoder* decoder, bool& isSet, T& value)
-{
- if (!decoder->decodeBool(isSet))
- return false;
- if (!isSet)
- return true;
-
- return decoder->decodeEnum(value);
-}
-
-bool ArgumentCoder<RefPtr<Animation> >::decode(ArgumentDecoder* decoder, RefPtr<Animation>& animation)
-{
- bool isDelaySet, isDirectionSet, isDurationSet, isFillModeSet, isIterationCountSet, isNameSet, isPlayStateSet, isPropertySet, isTimingFunctionSet;
- int property, iterationCount, fillMode;
- double duration;
- RefPtr<TimingFunction> timingFunction;
- String name;
-
- double delay;
- if (!decodeBoolAndValue(decoder, isDelaySet, delay))
- return false;
-
- Animation::AnimationDirection direction = Animation::AnimationDirectionNormal;
- if (!decodeBoolAndEnumValue(decoder, isDirectionSet, direction))
- return false;
- if (!decodeBoolAndValue(decoder, isDurationSet, duration))
- return false;
- if (!decodeBoolAndValue(decoder, isFillModeSet, fillMode))
- return false;
- if (!decodeBoolAndValue(decoder, isIterationCountSet, iterationCount))
- return false;
- if (!decodeBoolAndValue(decoder, isNameSet, name))
- return false;
-
- EAnimPlayState playState = AnimPlayStatePlaying;
- if (!decodeBoolAndEnumValue(decoder, isPlayStateSet, playState))
- return false;
- if (!decodeBoolAndValue(decoder, isPropertySet, property))
- return false;
- if (!decodeBoolAndValue<RefPtr<TimingFunction> >(decoder, isTimingFunctionSet, timingFunction))
- return false;
-
- animation = Animation::create();
- animation->clearAll();
-
- if (isDelaySet)
- animation->setDelay(delay);
- if (isDirectionSet)
- animation->setDirection(direction);
- if (isDurationSet)
- animation->setDuration(duration);
- if (isFillModeSet)
- animation->setFillMode(fillMode);
- if (isIterationCountSet)
- animation->setIterationCount(iterationCount);
- if (isNameSet)
- animation->setName(name);
- if (isPlayStateSet)
- animation->setPlayState(playState);
- if (isPropertySet)
- animation->setProperty(static_cast<CSSPropertyID>(property));
- if (isTimingFunctionSet)
- animation->setTimingFunction(timingFunction);
-
- return true;
-}
-
-#if USE(ACCELERATED_COMPOSITING)
-
-void ArgumentCoder<KeyframeValueList>::encode(ArgumentEncoder* encoder, const WebCore::KeyframeValueList& keyframes)
-{
- encoder->encodeUInt32(keyframes.size());
- encoder->encodeInt32(keyframes.property());
- for (size_t i = 0; i < keyframes.size(); ++i) {
- const WebCore::AnimationValue* value = keyframes.at(i);
- encoder->encodeFloat(value->keyTime());
- ArgumentCoder<RefPtr<WebCore::TimingFunction> >::encode(encoder, value->timingFunction());
- switch (keyframes.property()) {
- case WebCore::AnimatedPropertyOpacity: {
- const WebCore::FloatAnimationValue* floatValue = static_cast<const WebCore::FloatAnimationValue*>(value);
- encoder->encodeFloat(floatValue->value());
- break;
- }
- case WebCore::AnimatedPropertyWebkitTransform: {
- const WebCore::TransformAnimationValue* transformValue = static_cast<const WebCore::TransformAnimationValue*>(value);
- ArgumentCoder<WebCore::TransformOperations>::encode(encoder, *transformValue->value());
- break;
- }
- default:
- break;
- }
- }
-}
-
-bool ArgumentCoder<KeyframeValueList>::decode(ArgumentDecoder* decoder, WebCore::KeyframeValueList& keyframes)
-{
- uint32_t size;
- int32_t property;
- if (!decoder->decodeUInt32(size))
- return false;
- if (!decoder->decodeInt32(property))
- return false;
-
- keyframes = WebCore::KeyframeValueList(WebCore::AnimatedPropertyID(property));
-
- for (size_t i = 0; i < size; ++i) {
- float keyTime;
-
- RefPtr<WebCore::TimingFunction> timingFunction;
- if (!decoder->decodeFloat(keyTime))
- return false;
- if (!ArgumentCoder<RefPtr<WebCore::TimingFunction> >::decode(decoder, timingFunction))
- return false;
-
- switch (property) {
- case WebCore::AnimatedPropertyOpacity: {
- float value;
- if (!decoder->decodeFloat(value))
- return false;
- keyframes.insert(new WebCore::FloatAnimationValue(keyTime, value, timingFunction));
- break;
- }
- case WebCore::AnimatedPropertyWebkitTransform: {
- WebCore::TransformOperations value;
- if (!ArgumentCoder<WebCore::TransformOperations>::decode(decoder, value))
- return false;
- keyframes.insert(new WebCore::TransformAnimationValue(keyTime, &value, timingFunction));
- break;
- }
- default:
- break;
- }
- }
-
- return true;
-}
-
-#endif
-
-#if USE(UI_SIDE_COMPOSITING) && ENABLE(CSS_FILTERS)
+#if ENABLE(CSS_FILTERS)
void ArgumentCoder<WebCore::FilterOperations>::encode(ArgumentEncoder* encoder, const WebCore::FilterOperations& filters)
{
encoder->encodeUInt32(filters.size());
diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.h b/Source/WebKit2/Shared/WebCoreArgumentCoders.h
index d02f5fc17..2697408ed 100644
--- a/Source/WebKit2/Shared/WebCoreArgumentCoders.h
+++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.h
@@ -234,7 +234,7 @@ template<> struct ArgumentCoder<WebCore::KURL> {
static bool decode(ArgumentDecoder*, WebCore::KURL&);
};
-#if PLATFORM(QT)
+#if USE(UI_SIDE_COMPOSITING)
template<> struct ArgumentCoder<WebCore::FloatPoint3D> {
static void encode(ArgumentEncoder*, const WebCore::FloatPoint3D&);
static bool decode(ArgumentDecoder*, WebCore::FloatPoint3D&);
@@ -250,77 +250,15 @@ template<> struct ArgumentCoder<WebCore::TransformationMatrix> {
static bool decode(ArgumentDecoder*, WebCore::TransformationMatrix&);
};
-template<> struct ArgumentCoder<RefPtr<WebCore::MatrixTransformOperation> > {
- static void encode(ArgumentEncoder*, const WebCore::MatrixTransformOperation*);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::MatrixTransformOperation>&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::Matrix3DTransformOperation> > {
- static void encode(ArgumentEncoder*, const WebCore::Matrix3DTransformOperation*);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::Matrix3DTransformOperation>&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::PerspectiveTransformOperation> > {
- static void encode(ArgumentEncoder*, const WebCore::PerspectiveTransformOperation*);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::PerspectiveTransformOperation>&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::RotateTransformOperation> > {
- static void encode(ArgumentEncoder*, const WebCore::RotateTransformOperation*);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::RotateTransformOperation>&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::ScaleTransformOperation> > {
- static void encode(ArgumentEncoder*, const WebCore::ScaleTransformOperation*);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::ScaleTransformOperation>&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::SkewTransformOperation> > {
- static void encode(ArgumentEncoder*, const WebCore::SkewTransformOperation*);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::SkewTransformOperation>&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::TranslateTransformOperation> > {
- static void encode(ArgumentEncoder*, const WebCore::TranslateTransformOperation*);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::TranslateTransformOperation>&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::TimingFunction> > {
- static void encode(ArgumentEncoder*, const RefPtr<WebCore::TimingFunction>&);
- static void encode(ArgumentEncoder*, const WebCore::TimingFunction*);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::TimingFunction>&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::TransformOperation> > {
- static void encode(ArgumentEncoder*, const RefPtr<WebCore::TransformOperation>&);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::TransformOperation>&);
-};
-
-template<> struct ArgumentCoder<WebCore::TransformOperations> {
- static void encode(ArgumentEncoder*, const WebCore::TransformOperations&);
- static bool decode(ArgumentDecoder*, WebCore::TransformOperations&);
-};
-
-template<> struct ArgumentCoder<RefPtr<WebCore::Animation> > {
- static void encode(ArgumentEncoder*, const RefPtr<WebCore::Animation>&);
- static bool decode(ArgumentDecoder*, RefPtr<WebCore::Animation>&);
-};
-#endif
-
-#if USE(UI_SIDE_COMPOSITING) && ENABLE(CSS_FILTERS)
+#if ENABLE(CSS_FILTERS)
template<> struct ArgumentCoder<WebCore::FilterOperations> {
static void encode(ArgumentEncoder*, const WebCore::FilterOperations&);
static bool decode(ArgumentDecoder*, WebCore::FilterOperations&);
};
#endif
-
-#if USE(ACCELERATED_COMPOSITING)
-template<> struct ArgumentCoder<WebCore::KeyframeValueList> {
- static void encode(ArgumentEncoder*, const WebCore::KeyframeValueList& keyframes);
- static bool decode(ArgumentDecoder*, WebCore::KeyframeValueList& keyframes);
-};
#endif
+
} // namespace CoreIPC
#endif // WebCoreArgumentCoders_h
diff --git a/Source/WebKit2/Shared/efl/WebCoreArgumentCodersEfl.cpp b/Source/WebKit2/Shared/efl/WebCoreArgumentCodersEfl.cpp
new file mode 100755
index 000000000..a964883bb
--- /dev/null
+++ b/Source/WebKit2/Shared/efl/WebCoreArgumentCodersEfl.cpp
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebCoreArgumentCoders.h"
+
+#include <WebCore/ResourceError.h>
+#include <WebCore/ResourceRequest.h>
+#include <WebCore/ResourceResponse.h>
+
+using namespace WebCore;
+
+namespace CoreIPC {
+
+void ArgumentCoder<ResourceRequest>::encode(ArgumentEncoder* encoder, const ResourceRequest& resourceRequest)
+{
+ encoder->encode(resourceRequest.url().string());
+ encoder->encode(resourceRequest.httpHeaderField("Cookie"));
+}
+
+bool ArgumentCoder<ResourceRequest>::decode(ArgumentDecoder* decoder, ResourceRequest& resourceRequest)
+{
+ ResourceRequest request;
+
+ String url;
+ if (!decoder->decode(url))
+ return false;
+ request.setURL(KURL(KURL(), url));
+
+ String cookie;
+ if (!decoder->decode(cookie))
+ return false;
+ request.setHTTPHeaderField("Cookie", cookie);
+
+ resourceRequest = request;
+ return true;
+}
+
+
+void ArgumentCoder<ResourceResponse>::encode(ArgumentEncoder* encoder, const ResourceResponse& resourceResponse)
+{
+ encoder->encode(resourceResponse.mimeType());
+}
+
+bool ArgumentCoder<ResourceResponse>::decode(ArgumentDecoder* decoder, ResourceResponse& resourceResponse)
+{
+ ResourceResponse response;
+
+ String mimeType;
+ if (!decoder->decode(mimeType))
+ return false;
+ response.setMimeType(mimeType);
+
+ resourceResponse = response;
+ return true;
+}
+
+
+void ArgumentCoder<ResourceError>::encode(ArgumentEncoder* encoder, const ResourceError& resourceError)
+{
+ encoder->encode(resourceError.domain());
+ encoder->encode(resourceError.errorCode());
+ encoder->encode(resourceError.failingURL());
+ encoder->encode(resourceError.localizedDescription());
+}
+
+bool ArgumentCoder<ResourceError>::decode(ArgumentDecoder* decoder, ResourceError& resourceError)
+{
+ 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;
+
+ resourceError = ResourceError(domain, errorCode, failingURL, localizedDescription);
+ return true;
+}
+
+} // namespace CoreIPC
diff --git a/Source/WebKit2/Shared/efl/WebURLRequestEfl.cpp b/Source/WebKit2/Shared/efl/WebURLRequestEfl.cpp
new file mode 100755
index 000000000..2a498c441
--- /dev/null
+++ b/Source/WebKit2/Shared/efl/WebURLRequestEfl.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebURLRequestEfl.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebURLRequestEfl::WebURLRequestEfl(const WebURLRequest* request)
+ : m_request(request)
+{
+}
+
+const String WebURLRequestEfl::cookies() const
+{
+ if (!m_request)
+ return String();
+
+ return m_request->resourceRequest().httpHeaderField("Cookie");
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/Shared/efl/WebURLRequestEfl.h b/Source/WebKit2/Shared/efl/WebURLRequestEfl.h
new file mode 100755
index 000000000..8057db28f
--- /dev/null
+++ b/Source/WebKit2/Shared/efl/WebURLRequestEfl.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebURLRequestEfl_h
+#define WebURLRequestEfl_h
+
+#include "WebURLRequest.h"
+#include <wtf/Forward.h>
+#include <wtf/RefCounted.h>
+
+namespace WebKit {
+
+class WebURLRequestEfl : public RefCounted<WebURLRequestEfl> {
+public:
+ static PassRefPtr<WebURLRequestEfl> create(const WebURLRequest* request)
+ {
+ return adoptRef(new WebURLRequestEfl(request));
+ }
+
+ const String cookies() const;
+
+private:
+ explicit WebURLRequestEfl(const WebURLRequest*);
+
+ const WebURLRequest* m_request;
+};
+
+} // namespace WebKit
+
+#endif // WebURLRequestEfl_h
diff --git a/Source/WebKit2/Shared/efl/WebURLResponseEfl.cpp b/Source/WebKit2/Shared/efl/WebURLResponseEfl.cpp
new file mode 100755
index 000000000..55128a420
--- /dev/null
+++ b/Source/WebKit2/Shared/efl/WebURLResponseEfl.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebURLResponseEfl.h"
+
+namespace WebKit {
+
+WebURLResponseEfl::WebURLResponseEfl(const WebURLResponse* response)
+ : m_response(response)
+{
+}
+
+const String& WebURLResponseEfl::contentType() const
+{
+ if (!m_response)
+ return String();
+
+ return m_response->resourceResponse().mimeType();
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/Shared/efl/WebURLResponseEfl.h b/Source/WebKit2/Shared/efl/WebURLResponseEfl.h
new file mode 100755
index 000000000..1193a8023
--- /dev/null
+++ b/Source/WebKit2/Shared/efl/WebURLResponseEfl.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebURLResponseEfl_h
+#define WebURLResponseEfl_h
+
+#include "WebURLResponse.h"
+#include <wtf/Forward.h>
+#include <wtf/RefCounted.h>
+
+namespace WebKit {
+
+class WebURLResponseEfl : public RefCounted<WebURLResponseEfl> {
+public:
+ static PassRefPtr<WebURLResponseEfl> create(const WebURLResponse* response)
+ {
+ return adoptRef(new WebURLResponseEfl(response));
+ }
+
+ const String& contentType() const;
+
+private:
+ explicit WebURLResponseEfl(const WebURLResponse*);
+
+ const WebURLResponse* m_response;
+};
+
+} // namespace WebKit
+
+#endif // WebURLResponseEfl_h