From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/css/Counter.h | 50 +++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) (limited to 'Source/WebCore/css/Counter.h') diff --git a/Source/WebCore/css/Counter.h b/Source/WebCore/css/Counter.h index 205bf8bbe..76c3baee5 100644 --- a/Source/WebCore/css/Counter.h +++ b/Source/WebCore/css/Counter.h @@ -18,30 +18,33 @@ * Boston, MA 02110-1301, USA. */ -#ifndef Counter_h -#define Counter_h +#pragma once #include "CSSPrimitiveValue.h" #include namespace WebCore { -class Counter : public RefCounted { +class Counter final : public RefCounted { public: - static PassRefPtr create(PassRefPtr identifier, PassRefPtr listStyle, PassRefPtr separator) + static Ref create(Ref&& identifier, Ref&& listStyle, Ref&& separator) { - return adoptRef(new Counter(identifier, listStyle, separator)); + return adoptRef(*new Counter(WTFMove(identifier), WTFMove(listStyle), WTFMove(separator))); } - String identifier() const { return m_identifier ? m_identifier->getStringValue() : String(); } - String listStyle() const { return m_listStyle ? m_listStyle->getStringValue() : String(); } - String separator() const { return m_separator ? m_separator->getStringValue() : String(); } + String identifier() const { return m_identifier->stringValue(); } + String listStyle() const { return m_listStyle->stringValue(); } + String separator() const { return m_separator->stringValue(); } - CSSValueID listStyleIdent() const { return m_listStyle ? m_listStyle->getValueID() : CSSValueInvalid; } + const CSSPrimitiveValue& identifierValue() const { return m_identifier; } + const CSSPrimitiveValue& listStyleValue() const { return m_listStyle; } + const CSSPrimitiveValue& separatorValue() const { return m_separator; } + + CSSValueID listStyleIdent() const { return m_listStyle->valueID(); } - void setIdentifier(PassRefPtr identifier) { m_identifier = identifier; } - void setListStyle(PassRefPtr listStyle) { m_listStyle = listStyle; } - void setSeparator(PassRefPtr separator) { m_separator = separator; } + void setIdentifier(Ref&& identifier) { m_identifier = WTFMove(identifier); } + void setListStyle(Ref&& listStyle) { m_listStyle = WTFMove(listStyle); } + void setSeparator(Ref&& separator) { m_separator = WTFMove(separator); } bool equals(const Counter& other) const { @@ -49,27 +52,18 @@ public: && listStyle() == other.listStyle() && separator() == other.separator(); } - - PassRefPtr cloneForCSSOM() const - { - return create(m_identifier ? m_identifier->cloneForCSSOM() : 0 - , m_listStyle ? m_listStyle->cloneForCSSOM() : 0 - , m_separator ? m_separator->cloneForCSSOM() : 0); - } private: - Counter(PassRefPtr identifier, PassRefPtr listStyle, PassRefPtr separator) - : m_identifier(identifier) - , m_listStyle(listStyle) - , m_separator(separator) + Counter(Ref&& identifier, Ref&& listStyle, Ref&& separator) + : m_identifier(WTFMove(identifier)) + , m_listStyle(WTFMove(listStyle)) + , m_separator(WTFMove(separator)) { } - RefPtr m_identifier; // string - RefPtr m_listStyle; // ident - RefPtr m_separator; // string + Ref m_identifier; // string + Ref m_listStyle; // ident + Ref m_separator; // string }; } // namespace WebCore - -#endif // Counter_h -- cgit v1.2.1