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

Unified Diff: third_party/WebKit/Source/core/css/CSSValueList.cpp

Issue 1481383002: [Experimental] CSSSerializer Proof-of-concept Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: snapshot: top_25 sites ser/dser now works Created 4 years, 11 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
Index: third_party/WebKit/Source/core/css/CSSValueList.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSValueList.cpp b/third_party/WebKit/Source/core/css/CSSValueList.cpp
index 2573fb98d5a050abbc96aea900ac688024135e78..c015ab2ba69cbcf3732b5584f4935b94b728f295 100644
--- a/third_party/WebKit/Source/core/css/CSSValueList.cpp
+++ b/third_party/WebKit/Source/core/css/CSSValueList.cpp
@@ -21,6 +21,8 @@
#include "core/css/CSSValueList.h"
#include "core/css/CSSPrimitiveValue.h"
+#include "core/css/serializer/CSSDeserializeStream.h"
+#include "core/css/serializer/CSSSerializeStream.h"
#include "wtf/text/StringBuilder.h"
namespace blink {
@@ -124,6 +126,26 @@ bool CSSValueList::hasFailedOrCanceledSubresources() const
return false;
}
+CSSValueList::CSSValueList(ClassType classType, unsigned bitfields, CSSDeserializeStream* stream)
+ : CSSValue(classType)
+{
+ m_bitfields = bitfields;
+
+ unsigned len = stream->readUnsigned();
+ m_values.reserveCapacity(len);
+ for (unsigned i = 0; i < len; ++i) {
+ m_values.append(CSSValue::deserialize(stream));
+ }
+}
+
+void CSSValueList::serializeAfterDispatch(CSSSerializeStream* stream) const
+{
+ stream->writeUnsigned(m_values.size());
+ for (unsigned i = 0; i < m_values.size(); ++i) {
+ m_values[i]->serialize(stream);
+ }
+}
+
DEFINE_TRACE_AFTER_DISPATCH(CSSValueList)
{
visitor->trace(m_values);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValueList.h ('k') | third_party/WebKit/Source/core/css/CSSValuePair.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698