Diff
Modified: trunk/Source/WTF/ChangeLog (131225 => 131226)
--- trunk/Source/WTF/ChangeLog 2012-10-12 21:41:35 UTC (rev 131225)
+++ trunk/Source/WTF/ChangeLog 2012-10-12 21:45:56 UTC (rev 131226)
@@ -1,3 +1,22 @@
+2012-10-12 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r131224.
+ http://trac.webkit.org/changeset/131224
+ https://bugs.webkit.org/show_bug.cgi?id=99210
+
+ It broke the build (Requested by andersca on #webkit).
+
+ * wtf/Vector.h:
+ (WTF):
+ (WTF::operator<<):
+ (WTF::operator>>):
+ * wtf/qt/StringQt.cpp:
+ (WTF::operator<<):
+ (WTF):
+ (WTF::operator>>):
+ * wtf/text/WTFString.h:
+ (WTF):
+
2012-10-12 Anders Carlsson <[email protected]>
Move QDataStream functions into HistoryItemQt.cpp
Modified: trunk/Source/WTF/wtf/Vector.h (131225 => 131226)
--- trunk/Source/WTF/wtf/Vector.h 2012-10-12 21:41:35 UTC (rev 131225)
+++ trunk/Source/WTF/wtf/Vector.h 2012-10-12 21:45:56 UTC (rev 131226)
@@ -32,6 +32,10 @@
#include <limits>
#include <utility>
+#if PLATFORM(QT)
+#include <QDataStream>
+#endif
+
namespace WTF {
using std::min;
@@ -691,6 +695,32 @@
Buffer m_buffer;
};
+#if PLATFORM(QT)
+ template<typename T>
+ QDataStream& operator<<(QDataStream& stream, const Vector<T>& data)
+ {
+ stream << qint64(data.size());
+ foreach (const T& i, data)
+ stream << i;
+ return stream;
+ }
+
+ template<typename T>
+ QDataStream& operator>>(QDataStream& stream, Vector<T>& data)
+ {
+ data.clear();
+ qint64 count;
+ T item;
+ stream >> count;
+ data.reserveCapacity(count);
+ for (qint64 i = 0; i < count; ++i) {
+ stream >> item;
+ data.append(item);
+ }
+ return stream;
+ }
+#endif
+
template<typename T, size_t inlineCapacity>
Vector<T, inlineCapacity>::Vector(const Vector& other)
: m_size(other.size())
Modified: trunk/Source/WTF/wtf/qt/StringQt.cpp (131225 => 131226)
--- trunk/Source/WTF/wtf/qt/StringQt.cpp 2012-10-12 21:41:35 UTC (rev 131225)
+++ trunk/Source/WTF/wtf/qt/StringQt.cpp 2012-10-12 21:45:56 UTC (rev 131226)
@@ -70,6 +70,22 @@
return QString(reinterpret_cast<const QChar*>(characters()), length());
}
+QDataStream& operator<<(QDataStream& stream, const String& str)
+{
+ // could be faster
+ stream << QString(str);
+ return stream;
}
+QDataStream& operator>>(QDataStream& stream, String& str)
+{
+ // mabe not the fastest way, but really easy
+ QString tmp;
+ stream >> tmp;
+ str = tmp;
+ return stream;
+}
+
+}
+
// vim: ts=4 sw=4 et
Modified: trunk/Source/WTF/wtf/text/WTFString.h (131225 => 131226)
--- trunk/Source/WTF/wtf/text/WTFString.h 2012-10-12 21:41:35 UTC (rev 131225)
+++ trunk/Source/WTF/wtf/text/WTFString.h 2012-10-12 21:45:56 UTC (rev 131226)
@@ -40,6 +40,7 @@
QT_BEGIN_NAMESPACE
class QString;
QT_END_NAMESPACE
+#include <QDataStream>
#endif
#if PLATFORM(WX)
@@ -464,6 +465,11 @@
RefPtr<StringImpl> m_impl;
};
+#if PLATFORM(QT)
+QDataStream& operator<<(QDataStream& stream, const String& str);
+QDataStream& operator>>(QDataStream& stream, String& str);
+#endif
+
inline bool operator==(const String& a, const String& b) { return equal(a.impl(), b.impl()); }
inline bool operator==(const String& a, const LChar* b) { return equal(a.impl(), b); }
inline bool operator==(const String& a, const char* b) { return equal(a.impl(), reinterpret_cast<const LChar*>(b)); }
Modified: trunk/Source/WebCore/ChangeLog (131225 => 131226)
--- trunk/Source/WebCore/ChangeLog 2012-10-12 21:41:35 UTC (rev 131225)
+++ trunk/Source/WebCore/ChangeLog 2012-10-12 21:45:56 UTC (rev 131226)
@@ -1,3 +1,21 @@
+2012-10-12 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r131224.
+ http://trac.webkit.org/changeset/131224
+ https://bugs.webkit.org/show_bug.cgi?id=99210
+
+ It broke the build (Requested by andersca on #webkit).
+
+ * history/qt/HistoryItemQt.cpp:
+ * platform/FractionalLayoutUnit.h:
+ (WebCore):
+ (WebCore::operator<<):
+ (WebCore::operator>>):
+ * platform/graphics/IntPoint.h:
+ (WebCore):
+ (WebCore::operator<<):
+ (WebCore::operator>>):
+
2012-10-12 Anders Carlsson <[email protected]>
Move QDataStream functions into HistoryItemQt.cpp
Modified: trunk/Source/WebCore/history/qt/HistoryItemQt.cpp (131225 => 131226)
--- trunk/Source/WebCore/history/qt/HistoryItemQt.cpp 2012-10-12 21:41:35 UTC (rev 131225)
+++ trunk/Source/WebCore/history/qt/HistoryItemQt.cpp 2012-10-12 21:45:56 UTC (rev 131226)
@@ -23,79 +23,6 @@
#include "FormData.h"
#include <wtf/text/CString.h>
-static QDataStream& operator<<(QDataStream& stream, const FractionalLayoutUnit& value)
-{
- if (kFixedPointDenominator == 1)
- stream << value.rawValue();
- else
- stream << QString::fromLatin1("%1").arg(value.toFloat(), 0, 'f', 2);
-
- return stream;
-}
-
-static QDataStream& operator>>(QDataStream& stream, FractionalLayoutUnit& value)
-{
- float v;
- stream >> v;
- value = v;
- return stream;
-}
-
-static QDataStream& operator<<(QDataStream& stream, const IntPoint& point)
-{
- stream << point.x() << point.y();
- return stream;
-}
-
-static QDataStream& operator>>(QDataStream& stream, IntPoint& point)
-{
- int x, y;
- stream >> x >> y;
- point.setX(x);
- point.setY(y);
- return stream;
-}
-
-static QDataStream& operator<<(QDataStream& stream, const String& str)
-{
- // could be faster
- stream << QString(str);
- return stream;
-}
-
-static QDataStream& operator>>(QDataStream& stream, String& str)
-{
- // mabe not the fastest way, but really easy
- QString tmp;
- stream >> tmp;
- str = tmp;
- return stream;
-}
-
-template<typename T>
-QDataStream& operator<<(QDataStream& stream, const Vector<T>& data)
-{
- stream << qint64(data.size());
- foreach (const T& i, data)
- stream << i;
- return stream;
-}
-
-template<typename T>
-QDataStream& operator>>(QDataStream& stream, Vector<T>& data)
-{
- data.clear();
- qint64 count;
- T item;
- stream >> count;
- data.reserveCapacity(count);
- for (qint64 i = 0; i < count; ++i) {
- stream >> item;
- data.append(item);
- }
- return stream;
-}
-
bool WebCore::HistoryItem::restoreState(QDataStream& in, int version)
{
// we only support version 1 for now
Modified: trunk/Source/WebCore/platform/FractionalLayoutUnit.h (131225 => 131226)
--- trunk/Source/WebCore/platform/FractionalLayoutUnit.h 2012-10-12 21:41:35 UTC (rev 131225)
+++ trunk/Source/WebCore/platform/FractionalLayoutUnit.h 2012-10-12 21:45:56 UTC (rev 131226)
@@ -38,6 +38,10 @@
#include <wtf/MathExtras.h>
#include <wtf/SaturatedArithmetic.h>
+#if PLATFORM(QT)
+#include <QDataStream>
+#endif
+
namespace WebCore {
#ifdef NDEBUG
@@ -820,6 +824,26 @@
return (fraction + size).round() - fraction.round();
}
+#if PLATFORM(QT)
+inline QDataStream& operator<<(QDataStream& stream, const FractionalLayoutUnit& value)
+{
+ if (kFixedPointDenominator == 1)
+ stream << value.rawValue();
+ else
+ stream << QString::fromLatin1("%1").arg(value.toFloat(), 0, 'f', 2);
+
+ return stream;
+}
+
+inline QDataStream& operator>>(QDataStream& stream, FractionalLayoutUnit& value)
+{
+ float v;
+ stream >> v;
+ value = v;
+ return stream;
+}
+#endif
+
} // namespace WebCore
#endif // FractionalLayoutUnit_h
Modified: trunk/Source/WebCore/platform/graphics/IntPoint.h (131225 => 131226)
--- trunk/Source/WebCore/platform/graphics/IntPoint.h 2012-10-12 21:41:35 UTC (rev 131225)
+++ trunk/Source/WebCore/platform/graphics/IntPoint.h 2012-10-12 21:45:56 UTC (rev 131226)
@@ -29,6 +29,10 @@
#include "IntSize.h"
#include <wtf/MathExtras.h>
+#if PLATFORM(QT)
+#include <QDataStream>
+#endif
+
#if USE(CG) || USE(SKIA_ON_MAC_CHROMIUM)
typedef struct CGPoint CGPoint;
#endif
@@ -225,6 +229,23 @@
return ((*this) - point).diagonalLengthSquared();
}
+#if PLATFORM(QT)
+inline QDataStream& operator<<(QDataStream& stream, const IntPoint& point)
+{
+ stream << point.x() << point.y();
+ return stream;
+}
+
+inline QDataStream& operator>>(QDataStream& stream, IntPoint& point)
+{
+ int x, y;
+ stream >> x >> y;
+ point.setX(x);
+ point.setY(y);
+ return stream;
+}
+#endif
+
} // namespace WebCore
#endif // IntPoint_h