Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(803)

Unified Diff: Source/core/svg/SVGPathByteStream.h

Issue 130563014: Get rid of the *Byte types used for (de)serializing to SVGPathByteStream (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/svg/SVGPathByteStreamBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGPathByteStream.h
diff --git a/Source/core/svg/SVGPathByteStream.h b/Source/core/svg/SVGPathByteStream.h
index d596ce45fc879d04ac06b30dc5264071f9c70762..1fedc1e11a22853f75748c64a15df7d8027f44cb 100644
--- a/Source/core/svg/SVGPathByteStream.h
+++ b/Source/core/svg/SVGPathByteStream.h
@@ -26,21 +26,11 @@
namespace WebCore {
-// Type definitions for the byte stream data
-typedef union {
- bool value;
- unsigned char bytes[sizeof(bool)];
-} BoolByte;
-
-typedef union {
- float value;
- unsigned char bytes[sizeof(float)];
-} FloatByte;
-
-typedef union {
- unsigned short value;
- unsigned char bytes[sizeof(unsigned short)];
-} UnsignedShortByte;
+template<typename DataType>
+union ByteType {
+ DataType value;
+ unsigned char bytes[sizeof(DataType)];
+};
class SVGPathByteStream {
WTF_MAKE_FAST_ALLOCATED;
@@ -61,15 +51,11 @@ public:
DataIterator begin() { return m_data.begin(); }
DataIterator end() { return m_data.end(); }
void append(unsigned char byte) { m_data.append(byte); }
- void append(SVGPathByteStream* other)
- {
- for (DataIterator it = other->begin(); it != other->end(); ++it)
- append(*it);
- }
+ void append(SVGPathByteStream* other) { m_data.append(other->m_data); }
void clear() { m_data.clear(); }
void reserveInitialCapacity(size_t size) { m_data.reserveInitialCapacity(size); }
void shrinkToFit() { m_data.shrinkToFit(); }
- bool isEmpty() const { return !m_data.size(); }
+ bool isEmpty() const { return m_data.isEmpty(); }
unsigned size() const { return m_data.size(); }
// Only defined to let SVGAnimatedPathAnimator use the standard list code paths - this method is never called.
« no previous file with comments | « no previous file | Source/core/svg/SVGPathByteStreamBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698