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

Unified Diff: third_party/WebKit/Source/core/css/CSSKeyframesRule.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/CSSKeyframesRule.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp b/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp
index 9dbadee8a74fe5b3deb84c399a559a2ae3bfcb32..031348f4e76eda2fe7008df83de7b6079d49db97 100644
--- a/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp
+++ b/third_party/WebKit/Source/core/css/CSSKeyframesRule.cpp
@@ -29,6 +29,8 @@
#include "core/css/CSSRuleList.h"
#include "core/css/CSSStyleSheet.h"
#include "core/css/parser/CSSParser.h"
+#include "core/css/serializer/CSSDeserializeStream.h"
+#include "core/css/serializer/CSSSerializeStream.h"
#include "core/frame/UseCounter.h"
#include "wtf/text/StringBuilder.h"
@@ -84,6 +86,35 @@ int StyleRuleKeyframes::findKeyframeIndex(const String& key) const
return -1;
}
+void StyleRuleKeyframes::serializeAfterDispatch(CSSSerializeStream* stream) const
+{
+ stream->writeUnsigned(m_keyframes.size());
+ for (const RefPtrWillBeMember<StyleRuleKeyframe>& keyframe : m_keyframes)
+ keyframe->serialize(stream);
+
+ stream->writeAtomicString(m_name);
+ stream->writeUnsigned(m_version);
+ stream->writeBool(m_isPrefixed);
+}
+
+PassRefPtrWillBeRawPtr<StyleRuleKeyframes> StyleRuleKeyframes::deserializeAfterDispatch(CSSDeserializeStream* stream)
+{
+ RefPtrWillBeRawPtr<StyleRuleKeyframes> rule = adoptRefWillBeNoop(new StyleRuleKeyframes());
+
+ unsigned size = stream->readUnsigned();
+ rule->m_keyframes.reserveCapacity(size);
+ for (unsigned i = 0; i < size; ++ i) {
+ RefPtrWillBeRawPtr<StyleRuleBase> keyframeRule = StyleRuleBase::deserialize(stream);
+ rule->m_keyframes.append(toStyleRuleKeyframe(keyframeRule.get()));
+ }
+
+ rule->m_name = stream->readAtomicString();
+ rule->m_version = stream->readUnsigned();
+ rule->m_isPrefixed = stream->readBool();
+
+ return rule.release();
+}
+
DEFINE_TRACE_AFTER_DISPATCH(StyleRuleKeyframes)
{
visitor->trace(m_keyframes);
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSKeyframesRule.h ('k') | third_party/WebKit/Source/core/css/CSSPrimitiveValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698