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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSStringValue.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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/CSSStringValue.h" 5 #include "core/css/CSSStringValue.h"
6 6
7 #include "core/css/CSSMarkup.h" 7 #include "core/css/CSSMarkup.h"
8 #include "core/css/serializer/CSSDeserializeStream.h"
9 #include "core/css/serializer/CSSSerializeStream.h"
8 #include "wtf/text/WTFString.h" 10 #include "wtf/text/WTFString.h"
9 11
10 namespace blink { 12 namespace blink {
11 13
12 CSSStringValue::CSSStringValue(const String& str) 14 CSSStringValue::CSSStringValue(const String& str)
13 : CSSValue(StringClass) 15 : CSSValue(StringClass)
14 , m_string(str) { } 16 , m_string(str) { }
15 17
18 PassRefPtrWillBeRawPtr<CSSStringValue> CSSStringValue::deserializeAfterDispatch( CSSDeserializeStream* stream)
19 {
20 String string = stream->readString();
21 return CSSStringValue::create(string);
22 }
23
16 String CSSStringValue::customCSSText() const 24 String CSSStringValue::customCSSText() const
17 { 25 {
18 return serializeString(m_string); 26 return serializeString(m_string);
19 } 27 }
20 28
29 void CSSStringValue::serializeAfterDispatch(CSSSerializeStream* stream) const
30 {
31 stream->writeString(m_string);
32 }
33
21 DEFINE_TRACE_AFTER_DISPATCH(CSSStringValue) 34 DEFINE_TRACE_AFTER_DISPATCH(CSSStringValue)
22 { 35 {
23 CSSValue::traceAfterDispatch(visitor); 36 CSSValue::traceAfterDispatch(visitor);
24 } 37 }
25 38
26 } // namespace blink 39 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSStringValue.h ('k') | third_party/WebKit/Source/core/css/CSSTimingFunctionValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698