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

Unified Diff: third_party/WebKit/Source/core/css/CSSQuadValue.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
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSQuadValue.h ('k') | third_party/WebKit/Source/core/css/CSSSelector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSQuadValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSQuadValue.cpp b/third_party/WebKit/Source/core/css/CSSQuadValue.cpp
index 5fb5f12625da94b1fa570b9a72bf127a0d02a116..3bd2b0ff129159d773133f948cdbaed923849fd0 100644
--- a/third_party/WebKit/Source/core/css/CSSQuadValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSQuadValue.cpp
@@ -4,10 +4,27 @@
#include "core/css/CSSQuadValue.h"
+#include "core/css/serializer/CSSDeserializeStream.h"
+#include "core/css/serializer/CSSSerializeStream.h"
#include "wtf/text/StringBuilder.h"
namespace blink {
+PassRefPtrWillBeRawPtr<CSSQuadValue> CSSQuadValue::deserializeAfterDispatch(CSSDeserializeStream* stream)
+{
+ SerializationType serializationType = static_cast<SerializationType>(stream->readBool());
+ RefPtrWillBeRawPtr<CSSValue> top = CSSValue::deserialize(stream);
+ RefPtrWillBeRawPtr<CSSValue> right = CSSValue::deserialize(stream);
+ RefPtrWillBeRawPtr<CSSValue> left = CSSValue::deserialize(stream);
+ RefPtrWillBeRawPtr<CSSValue> bottom = CSSValue::deserialize(stream);
+ return create(
+ toCSSPrimitiveValue(top.get()),
+ toCSSPrimitiveValue(right.get()),
+ toCSSPrimitiveValue(left.get()),
+ toCSSPrimitiveValue(bottom.get()),
+ serializationType);
+}
+
String CSSQuadValue::customCSSText() const
{
String top = m_top->cssText();
@@ -37,6 +54,15 @@ String CSSQuadValue::customCSSText() const
return result.toString();
}
+void CSSQuadValue::serializeAfterDispatch(CSSSerializeStream* stream) const
+{
+ stream->writeBool(m_serializationType);
+ m_top->serialize(stream);
+ m_right->serialize(stream);
+ m_bottom->serialize(stream);
+ m_left->serialize(stream);
+}
+
DEFINE_TRACE_AFTER_DISPATCH(CSSQuadValue)
{
visitor->trace(m_top);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSQuadValue.h ('k') | third_party/WebKit/Source/core/css/CSSSelector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698