diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/css/CSSRuleList.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/css/CSSRuleList.h')
-rw-r--r-- | Source/WebCore/css/CSSRuleList.h | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/Source/WebCore/css/CSSRuleList.h b/Source/WebCore/css/CSSRuleList.h index 4da15b488..35a0925fe 100644 --- a/Source/WebCore/css/CSSRuleList.h +++ b/Source/WebCore/css/CSSRuleList.h @@ -1,7 +1,7 @@ /* * (C) 1999-2003 Lars Knoll (knoll@kde.org) * (C) 2002-2003 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2002, 2006, 2012 Apple Computer, Inc. + * Copyright (C) 2002, 2006, 2012 Apple Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -19,14 +19,10 @@ * Boston, MA 02110-1301, USA. */ -#ifndef CSSRuleList_h -#define CSSRuleList_h +#pragma once -#include <wtf/PassRefPtr.h> -#include <wtf/RefCounted.h> #include <wtf/RefPtr.h> #include <wtf/Vector.h> -#include <wtf/text/WTFString.h> namespace WebCore { @@ -50,23 +46,23 @@ protected: CSSRuleList(); }; -class StaticCSSRuleList : public CSSRuleList { +class StaticCSSRuleList final : public CSSRuleList { public: - static PassRefPtr<StaticCSSRuleList> create() { return adoptRef(new StaticCSSRuleList()); } + static Ref<StaticCSSRuleList> create() { return adoptRef(*new StaticCSSRuleList); } - virtual void ref() { ++m_refCount; } - virtual void deref(); + void ref() final { ++m_refCount; } + void deref() final; Vector<RefPtr<CSSRule>>& rules() { return m_rules; } - virtual CSSStyleSheet* styleSheet() const { return 0; } + CSSStyleSheet* styleSheet() const final { return nullptr; } private: StaticCSSRuleList(); ~StaticCSSRuleList(); - virtual unsigned length() const { return m_rules.size(); } - virtual CSSRule* item(unsigned index) const { return index < m_rules.size() ? m_rules[index].get() : 0; } + unsigned length() const final { return m_rules.size(); } + CSSRule* item(unsigned index) const final { return index < m_rules.size() ? m_rules[index].get() : nullptr; } Vector<RefPtr<CSSRule>> m_rules; unsigned m_refCount; @@ -74,21 +70,22 @@ private: // The rule owns the live list. template <class Rule> -class LiveCSSRuleList : public CSSRuleList { +class LiveCSSRuleList final : public CSSRuleList { public: - LiveCSSRuleList(Rule* rule) : m_rule(rule) { } + LiveCSSRuleList(Rule& rule) + : m_rule(rule) + { + } - virtual void ref() { m_rule->ref(); } - virtual void deref() { m_rule->deref(); } + void ref() final { m_rule.ref(); } + void deref() final { m_rule.deref(); } private: - virtual unsigned length() const { return m_rule->length(); } - virtual CSSRule* item(unsigned index) const { return m_rule->item(index); } - virtual CSSStyleSheet* styleSheet() const { return m_rule->parentStyleSheet(); } + unsigned length() const final { return m_rule.length(); } + CSSRule* item(unsigned index) const final { return m_rule.item(index); } + CSSStyleSheet* styleSheet() const final { return m_rule.parentStyleSheet(); } - Rule* m_rule; + Rule& m_rule; }; } // namespace WebCore - -#endif // CSSRuleList_h |