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

Unified Diff: third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.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/CSSFontFaceSrcValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
index 0b2cedadd84d6f02d157eca12d7684e002ed3fbf..e1643314e30143bb575fc90aa8d3b19c57732a28 100644
--- a/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp
@@ -27,6 +27,8 @@
#include "core/css/CSSMarkup.h"
#include "core/css/StyleSheetContents.h"
+#include "core/css/serializer/CSSDeserializeStream.h"
+#include "core/css/serializer/CSSSerializeStream.h"
#include "core/dom/Document.h"
#include "core/dom/Node.h"
#include "core/fetch/FetchInitiatorTypeNames.h"
@@ -123,4 +125,28 @@ bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const
return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resource == other.m_resource;
}
+void CSSFontFaceSrcValue::serializeAfterDispatch(CSSSerializeStream* stream) const
+{
+ stream->writeString(m_resource);
+ stream->writeString(m_format);
+ stream->writeReferrer(m_referrer);
+ stream->writeBool(m_isLocal);
+ stream->writeEnumAsInt<ContentSecurityPolicyDisposition>(m_shouldCheckContentSecurityPolicy);
+}
+
+PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> CSSFontFaceSrcValue::deserializeAfterDispatch(CSSDeserializeStream* stream)
+{
+ String resource = stream->readString();
+ String format = stream->readString();
+ Referrer referrer = stream->readReferrer();
+ bool isLocal = stream->readBool();
+ ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy = stream->readIntAsEnum<ContentSecurityPolicyDisposition>();
+
+ RefPtrWillBeRawPtr<CSSFontFaceSrcValue> value = adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, isLocal, shouldCheckContentSecurityPolicy));
+ value->setFormat(format);
+ value->setReferrer(referrer);
+
+ return value.release();
+}
+
}
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.h ('k') | third_party/WebKit/Source/core/css/CSSFontFeatureValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698