Source/WebKit2/ChangeLog

 12011-06-06 Sheriff Bot <webkit.review.bot@gmail.com>
 2
 3 Unreviewed, rolling out r88222.
 4 http://trac.webkit.org/changeset/88222
 5 https://bugs.webkit.org/show_bug.cgi?id=62192
 6
 7 Broke compile on Mac (Requested by abarth on #webkit).
 8
 9 * Scripts/webkit2/messages.py:
 10 * Shared/WebCoreArgumentCoders.h:
 11
1122011-06-06 Noam Rosenthal <noam.rosenthal@nokia.com>
213
314 Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2/Scripts/webkit2/messages.py

@@def struct_or_class(namespace, type):
255255 'WebCore::EditorCommandsForKeyEvent',
256256 'WebCore::CompositionUnderline',
257257 'WebCore::GrammarDetail',
258  'WebCore::IdentityTransformOperation',
259258 'WebCore::KeypressCommand',
260259 'WebCore::Length',
261  'WebCore::MatrixTransformOperation',
262  'WebCore::Matrix3DTransformOperation',
263  'WebCore::PerspectiveTransformOperation',
264260 'WebCore::PluginInfo',
265261 'WebCore::PrintInfo',
266  'WebCore::RotateTransformOperation',
267  'WebCore::ScaleTransformOperation',
268  'WebCore::SkewTransformOperation',
269262 'WebCore::TimingFunction',
270263 'WebCore::TransformationMatrix',
271  'WebCore::TransformOperation',
272  'WebCore::TransformOperations',
273  'WebCore::TranslateTransformOperation',
274264 'WebCore::ViewportArguments',
275265 'WebCore::WindowFeatures',
276266 'WebKit::AttributedString',

Source/WebKit2/Shared/WebCoreArgumentCoders.h

4141#include <WebCore/EditorClient.h>
4242#include <WebCore/FloatRect.h>
4343#include <WebCore/GraphicsContext.h>
44 #include <WebCore/IdentityTransformOperation.h>
4544#include <WebCore/IntRect.h>
4645#include <WebCore/KeyboardEvent.h>
4746#include <WebCore/Length.h>
48 #include <WebCore/Matrix3DTransformOperation.h>
49 #include <WebCore/MatrixTransformOperation.h>
50 #include <WebCore/PerspectiveTransformOperation.h>
5147#include <WebCore/PluginData.h>
5248#include <WebCore/ProtectionSpace.h>
5349#include <WebCore/ResourceError.h>
5450#include <WebCore/ResourceRequest.h>
55 #include <WebCore/RotateTransformOperation.h>
56 #include <WebCore/ScaleTransformOperation.h>
57 #include <WebCore/SkewTransformOperation.h>
5851#include <WebCore/TextCheckerClient.h>
5952#include <WebCore/TimingFunction.h>
60 #include <WebCore/TransformOperation.h>
61 #include <WebCore/TransformOperations.h>
6253#include <WebCore/TransformationMatrix.h>
63 #include <WebCore/TranslateTransformOperation.h>
6454#include <WebCore/ViewportArguments.h>
6555#include <WebCore/WindowFeatures.h>
6656#include <limits>
6757
6858
69 
70 
7159namespace CoreIPC {
7260
7361template<> struct ArgumentCoder<WebCore::IntPoint> : SimpleArgumentCoder<WebCore::IntPoint> { };

@@template<> struct ArgumentCoder<WebCore::FloatRect> : SimpleArgumentCoder<WebCor
8169template<> struct ArgumentCoder<WebCore::Length> : SimpleArgumentCoder<WebCore::Length> { };
8270template<> struct ArgumentCoder<WebCore::TransformationMatrix> : SimpleArgumentCoder<WebCore::TransformationMatrix> { };
8371
84 template<> struct ArgumentCoder<WebCore::MatrixTransformOperation> : SimpleArgumentCoder<WebCore::MatrixTransformOperation> { };
85 template<> struct ArgumentCoder<WebCore::Matrix3DTransformOperation> : SimpleArgumentCoder<WebCore::Matrix3DTransformOperation> { };
86 template<> struct ArgumentCoder<WebCore::PerspectiveTransformOperation> : SimpleArgumentCoder<WebCore::PerspectiveTransformOperation> { };
87 template<> struct ArgumentCoder<WebCore::RotateTransformOperation> : SimpleArgumentCoder<WebCore::RotateTransformOperation> { };
88 template<> struct ArgumentCoder<WebCore::ScaleTransformOperation> : SimpleArgumentCoder<WebCore::ScaleTransformOperation> { };
89 template<> struct ArgumentCoder<WebCore::SkewTransformOperation> : SimpleArgumentCoder<WebCore::SkewTransformOperation> { };
90 template<> struct ArgumentCoder<WebCore::TranslateTransformOperation> : SimpleArgumentCoder<WebCore::TranslateTransformOperation> { };
91 
9272template<> struct ArgumentCoder<WebCore::MimeClassInfo> {
9373 static void encode(ArgumentEncoder* encoder, const WebCore::MimeClassInfo& mimeClassInfo)
9474 {

@@template<> struct ArgumentCoder<RefPtr<WebCore::TimingFunction> > {
580560 }
581561};
582562
583 template<> struct ArgumentCoder<RefPtr<WebCore::TransformOperation> > {
584  template<class T>
585  static bool decodeOperation(ArgumentDecoder* decoder, RefPtr<WebCore::TransformOperation>& operation, PassRefPtr<T> newOperation)
586  {
587  if (!ArgumentCoder<T>::decode(decoder, *newOperation.get()))
588  return false;
589  operation = newOperation.get();
590  return true;
591  }
592 
593  template<class T>
594  static void encodeOperation(ArgumentEncoder* encoder, const WebCore::TransformOperation* operation)
595  {
596  ArgumentCoder<T>::encode(encoder, *static_cast<const T*>(operation));
597  }
598 
599  static void encode(ArgumentEncoder* encoder, const RefPtr<WebCore::TransformOperation>& operation)
600  {
601  // We don't want to encode null-references.
602  ASSERT(operation);
603 
604  WebCore::TransformOperation::OperationType type = operation->getOperationType();
605  encoder->encodeInt32(type);
606  switch (type) {
607  case WebCore::TransformOperation::SCALE:
608  case WebCore::TransformOperation::SCALE_X:
609  case WebCore::TransformOperation::SCALE_Y:
610  case WebCore::TransformOperation::SCALE_Z:
611  case WebCore::TransformOperation::SCALE_3D:
612  encodeOperation<WebCore::ScaleTransformOperation>(encoder, operation.get());
613  return;
614 
615  case WebCore::TransformOperation::TRANSLATE:
616  case WebCore::TransformOperation::TRANSLATE_X:
617  case WebCore::TransformOperation::TRANSLATE_Y:
618  case WebCore::TransformOperation::TRANSLATE_Z:
619  case WebCore::TransformOperation::TRANSLATE_3D:
620  encodeOperation<WebCore::TranslateTransformOperation>(encoder, operation.get());
621  return;
622 
623  case WebCore::TransformOperation::ROTATE:
624  case WebCore::TransformOperation::ROTATE_X:
625  case WebCore::TransformOperation::ROTATE_Y:
626  case WebCore::TransformOperation::ROTATE_3D:
627  encodeOperation<WebCore::RotateTransformOperation>(encoder, operation.get());
628  return;
629 
630  case WebCore::TransformOperation::SKEW:
631  case WebCore::TransformOperation::SKEW_X:
632  case WebCore::TransformOperation::SKEW_Y:
633  encodeOperation<WebCore::SkewTransformOperation>(encoder, operation.get());
634  return;
635 
636  case WebCore::TransformOperation::MATRIX:
637  encodeOperation<WebCore::MatrixTransformOperation>(encoder, operation.get());
638  return;
639 
640  case WebCore::TransformOperation::MATRIX_3D:
641  encodeOperation<WebCore::Matrix3DTransformOperation>(encoder, operation.get());
642  return;
643 
644  case WebCore::TransformOperation::PERSPECTIVE:
645  encodeOperation<WebCore::PerspectiveTransformOperation>(encoder, operation.get());
646  return;
647 
648  case WebCore::TransformOperation::IDENTITY:
649  case WebCore::TransformOperation::NONE:
650  return;
651  }
652  }
653 
654  static bool decode(ArgumentDecoder* decoder, RefPtr<WebCore::TransformOperation>& operation)
655  {
656  WebCore::TransformOperation::OperationType type;
657  int typeInt;
658  if (!decoder->decodeInt32(typeInt))
659  return false;
660  type = static_cast<WebCore::TransformOperation::OperationType>(typeInt);
661  switch (type) {
662  case WebCore::TransformOperation::SCALE:
663  case WebCore::TransformOperation::SCALE_X:
664  case WebCore::TransformOperation::SCALE_Y:
665  case WebCore::TransformOperation::SCALE_Z:
666  case WebCore::TransformOperation::SCALE_3D:
667  return decodeOperation<WebCore::ScaleTransformOperation>(decoder, operation, WebCore::ScaleTransformOperation::create(1.0, 1.0, type));
668 
669  case WebCore::TransformOperation::TRANSLATE:
670  case WebCore::TransformOperation::TRANSLATE_X:
671  case WebCore::TransformOperation::TRANSLATE_Y:
672  case WebCore::TransformOperation::TRANSLATE_Z:
673  case WebCore::TransformOperation::TRANSLATE_3D:
674  return decodeOperation<WebCore::TranslateTransformOperation>(decoder, operation, WebCore::TranslateTransformOperation::create(WebCore::Length(0, WebCore::Fixed), WebCore::Length(0, WebCore::Fixed), type));
675 
676  case WebCore::TransformOperation::ROTATE:
677  case WebCore::TransformOperation::ROTATE_X:
678  case WebCore::TransformOperation::ROTATE_Y:
679  case WebCore::TransformOperation::ROTATE_3D:
680  return decodeOperation<WebCore::RotateTransformOperation>(decoder, operation, WebCore::RotateTransformOperation::create(0.0, type));
681 
682  case WebCore::TransformOperation::SKEW:
683  case WebCore::TransformOperation::SKEW_X:
684  case WebCore::TransformOperation::SKEW_Y:
685  return decodeOperation<WebCore::SkewTransformOperation>(decoder, operation, WebCore::SkewTransformOperation::create(0.0, 0.0, type));
686 
687  case WebCore::TransformOperation::MATRIX:
688  return decodeOperation<WebCore::MatrixTransformOperation>(decoder, operation, WebCore::MatrixTransformOperation::create(WebCore::TransformationMatrix()));
689 
690  case WebCore::TransformOperation::MATRIX_3D:
691  return decodeOperation<WebCore::Matrix3DTransformOperation>(decoder, operation, WebCore::Matrix3DTransformOperation::create(WebCore::TransformationMatrix()));
692 
693  case WebCore::TransformOperation::PERSPECTIVE:
694  return decodeOperation<WebCore::PerspectiveTransformOperation>(decoder, operation, WebCore::PerspectiveTransformOperation::create(WebCore::Length(0, WebCore::Fixed)));
695 
696  case WebCore::TransformOperation::IDENTITY:
697  case WebCore::TransformOperation::NONE:
698  operation = WebCore::IdentityTransformOperation::create();
699  return true;
700  }
701 
702  return false;
703  }
704 };
705 
706 template<> struct ArgumentCoder<WebCore::TransformOperations> {
707  static void encode(ArgumentEncoder* encoder, const WebCore::TransformOperations& operations)
708  {
709  WTF::Vector<RefPtr<WebCore::TransformOperation> > operationsVector = operations.operations();
710  int size = operationsVector.size();
711  encoder->encodeInt32(size);
712  for (int i = 0; i < size; ++i)
713  ArgumentCoder<RefPtr<WebCore::TransformOperation> >::encode(encoder, operationsVector[i]);
714  }
715 
716  static bool decode(ArgumentDecoder* decoder, WebCore::TransformOperations& operations)
717  {
718  int size;
719  if (!decoder->decodeInt32(size))
720  return false;
721 
722  WTF::Vector<RefPtr<WebCore::TransformOperation> >& operationVector = operations.operations();
723  operationVector.clear();
724  operationVector.resize(size);
725  for (int i = 0; i < size; ++i) {
726  RefPtr<WebCore::TransformOperation> operation;
727  if (!ArgumentCoder<RefPtr<WebCore::TransformOperation> >::decode(decoder, operation))
728  return false;
729  operationVector[i] = operation;
730  }
731 
732  return true;
733  }
734 };
735 
736 
737563template<> struct ArgumentCoder<WebCore::Animation> {
738564 static bool encodeBoolAndReturnValue(ArgumentEncoder* encoder, bool value)
739565 {