Commit 95ec31dd authored by tasak@google.com's avatar tasak@google.com

Make blink classes and structures in core/css fast-allocated

Added STATIC_ONLY, STACK_ALLOCATED, DISALLOW_ALLOCATION, or ALLOW_ONLY_INLINE_ALLOCATION
instead of WTF_MAKE_FAST_ALLOCATED(_WILL_BE_REMOVED) if possible.

BUG=523249

Review URL: https://codereview.chromium.org/1304623002

git-svn-id: svn://svn.chromium.org/blink/trunk@200982 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 297900a7
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#define CSSDefaultStyleSheets_h #define CSSDefaultStyleSheets_h
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -32,6 +33,8 @@ class RuleSet; ...@@ -32,6 +33,8 @@ class RuleSet;
class StyleSheetContents; class StyleSheetContents;
class CSSDefaultStyleSheets : public NoBaseWillBeGarbageCollected<CSSDefaultStyleSheets> { class CSSDefaultStyleSheets : public NoBaseWillBeGarbageCollected<CSSDefaultStyleSheets> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CSSDefaultStyleSheets);
WTF_MAKE_NONCOPYABLE(CSSDefaultStyleSheets);
public: public:
static CSSDefaultStyleSheets& instance(); static CSSDefaultStyleSheets& instance();
......
...@@ -42,6 +42,7 @@ class RemoteFontFaceSource; ...@@ -42,6 +42,7 @@ class RemoteFontFaceSource;
class SimpleFontData; class SimpleFontData;
class CORE_EXPORT CSSFontFace final : public NoBaseWillBeGarbageCollectedFinalized<CSSFontFace> { class CORE_EXPORT CSSFontFace final : public NoBaseWillBeGarbageCollectedFinalized<CSSFontFace> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CSSFontFace);
WTF_MAKE_NONCOPYABLE(CSSFontFace); WTF_MAKE_NONCOPYABLE(CSSFontFace);
public: public:
struct UnicodeRange; struct UnicodeRange;
...@@ -73,6 +74,7 @@ public: ...@@ -73,6 +74,7 @@ public:
PassRefPtr<SimpleFontData> getFontData(const FontDescription&); PassRefPtr<SimpleFontData> getFontData(const FontDescription&);
struct UnicodeRange { struct UnicodeRange {
ALLOW_ONLY_INLINE_ALLOCATION();
UnicodeRange(UChar32 from, UChar32 to) UnicodeRange(UChar32 from, UChar32 to)
: m_from(from) : m_from(from)
, m_to(to) , m_to(to)
...@@ -91,6 +93,7 @@ public: ...@@ -91,6 +93,7 @@ public:
}; };
class CORE_EXPORT UnicodeRangeSet { class CORE_EXPORT UnicodeRangeSet {
ALLOW_ONLY_INLINE_ALLOCATION();
public: public:
explicit UnicodeRangeSet(const Vector<UnicodeRange>&); explicit UnicodeRangeSet(const Vector<UnicodeRange>&);
bool contains(UChar32) const; bool contains(UChar32) const;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define CSSFontFaceSource_h #define CSSFontFaceSource_h
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
#include "wtf/HashMap.h" #include "wtf/HashMap.h"
namespace blink { namespace blink {
...@@ -37,6 +38,8 @@ class FontDescription; ...@@ -37,6 +38,8 @@ class FontDescription;
class SimpleFontData; class SimpleFontData;
class CSSFontFaceSource : public NoBaseWillBeGarbageCollectedFinalized<CSSFontFaceSource> { class CSSFontFaceSource : public NoBaseWillBeGarbageCollectedFinalized<CSSFontFaceSource> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CSSFontFaceSource);
WTF_MAKE_NONCOPYABLE(CSSFontFaceSource);
public: public:
virtual ~CSSFontFaceSource(); virtual ~CSSFontFaceSource();
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "core/css/CSSValueList.h" #include "core/css/CSSValueList.h"
#include "core/fetch/ResourceLoaderOptions.h" #include "core/fetch/ResourceLoaderOptions.h"
#include "platform/weborigin/Referrer.h" #include "platform/weborigin/Referrer.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -56,6 +57,7 @@ public: ...@@ -56,6 +57,7 @@ public:
bool isPending() const { return !m_accessedBestFitImage; } bool isPending() const { return !m_accessedBestFitImage; }
struct ImageWithScale { struct ImageWithScale {
ALLOW_ONLY_INLINE_ALLOCATION();
String imageURL; String imageURL;
Referrer referrer; Referrer referrer;
float scaleFactor; float scaleFactor;
......
...@@ -27,12 +27,14 @@ ...@@ -27,12 +27,14 @@
#include "platform/RuntimeEnabledFeatures.h" #include "platform/RuntimeEnabledFeatures.h"
#include "platform/text/TextDirection.h" #include "platform/text/TextDirection.h"
#include "platform/text/WritingMode.h" #include "platform/text/WritingMode.h"
#include "wtf/Allocator.h"
#include "wtf/PassRefPtr.h" #include "wtf/PassRefPtr.h"
#include "wtf/RefPtr.h" #include "wtf/RefPtr.h"
namespace blink { namespace blink {
struct StylePropertyMetadata { struct StylePropertyMetadata {
DISALLOW_ALLOCATION();
StylePropertyMetadata(CSSPropertyID propertyID, bool isSetFromShorthand, int indexInShorthandsVector, bool important, bool implicit, bool inherited) StylePropertyMetadata(CSSPropertyID propertyID, bool isSetFromShorthand, int indexInShorthandsVector, bool important, bool implicit, bool inherited)
: m_propertyID(propertyID) : m_propertyID(propertyID)
, m_isSetFromShorthand(isSetFromShorthand) , m_isSetFromShorthand(isSetFromShorthand)
......
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
#define CSSPropertyMetadata_h #define CSSPropertyMetadata_h
#include "core/CSSPropertyNames.h" #include "core/CSSPropertyNames.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class CSSPropertyMetadata { class CSSPropertyMetadata {
STATIC_ONLY(CSSPropertyMetadata);
public: public:
static bool isEnabledProperty(CSSPropertyID); static bool isEnabledProperty(CSSPropertyID);
static bool isInterpolableProperty(CSSPropertyID); static bool isInterpolableProperty(CSSPropertyID);
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define CSSTestHelper_h #define CSSTestHelper_h
#include "core/css/RuleSet.h" #include "core/css/RuleSet.h"
#include "wtf/Allocator.h"
#include "wtf/RefPtr.h" #include "wtf/RefPtr.h"
namespace blink { namespace blink {
...@@ -46,6 +47,7 @@ class CSSStyleSheet; ...@@ -46,6 +47,7 @@ class CSSStyleSheet;
// ... examine RuleSet to find the rule and test properties on it. // ... examine RuleSet to find the rule and test properties on it.
class CSSTestHelper { class CSSTestHelper {
STACK_ALLOCATED();
public: public:
CSSTestHelper(); CSSTestHelper();
~CSSTestHelper(); ~CSSTestHelper();
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define CSSToLengthConversionData_h #define CSSToLengthConversionData_h
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "wtf/Allocator.h"
#include "wtf/Assertions.h" #include "wtf/Assertions.h"
#include "wtf/MathExtras.h" #include "wtf/MathExtras.h"
#include <limits> #include <limits>
...@@ -43,9 +44,11 @@ class LayoutView; ...@@ -43,9 +44,11 @@ class LayoutView;
class Font; class Font;
class CORE_EXPORT CSSToLengthConversionData { class CORE_EXPORT CSSToLengthConversionData {
DISALLOW_ALLOCATION();
public: public:
class FontSizes { class FontSizes {
DISALLOW_ALLOCATION();
public: public:
FontSizes() : m_em(0), m_rem(0), m_font(nullptr) { } FontSizes() : m_em(0), m_rem(0), m_font(nullptr) { }
FontSizes(float em, float rem, const Font*); FontSizes(float em, float rem, const Font*);
...@@ -62,6 +65,7 @@ public: ...@@ -62,6 +65,7 @@ public:
}; };
class ViewportSize { class ViewportSize {
DISALLOW_ALLOCATION();
public: public:
ViewportSize() : m_width(0), m_height(0) { } ViewportSize() : m_width(0), m_height(0) { }
ViewportSize(double width, double height) : m_width(width), m_height(height) { } ViewportSize(double width, double height) : m_width(width), m_height(height) { }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "core/CSSPropertyNames.h" #include "core/CSSPropertyNames.h"
#include "core/css/CSSValue.h" #include "core/css/CSSValue.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -19,6 +20,7 @@ class StyleColor; ...@@ -19,6 +20,7 @@ class StyleColor;
class Node; class Node;
class ComputedStyleCSSValueMapping { class ComputedStyleCSSValueMapping {
STATIC_ONLY(ComputedStyleCSSValueMapping);
public: public:
// FIXME: Resolve computed auto alignment in applyProperty/ComputedStyle and remove this non-const styledNode parameter. // FIXME: Resolve computed auto alignment in applyProperty/ComputedStyle and remove this non-const styledNode parameter.
static PassRefPtrWillBeRawPtr<CSSValue> get(CSSPropertyID, const ComputedStyle&, const LayoutObject* = nullptr, Node* styledNode = nullptr, bool allowVisitedStyle = false); static PassRefPtrWillBeRawPtr<CSSValue> get(CSSPropertyID, const ComputedStyle&, const LayoutObject* = nullptr, Node* styledNode = nullptr, bool allowVisitedStyle = false);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define DocumentFontFaceSet_h #define DocumentFontFaceSet_h
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
#include "wtf/PassRefPtr.h" #include "wtf/PassRefPtr.h"
namespace blink { namespace blink {
...@@ -35,6 +36,7 @@ class Document; ...@@ -35,6 +36,7 @@ class Document;
class FontFaceSet; class FontFaceSet;
class DocumentFontFaceSet { class DocumentFontFaceSet {
STATIC_ONLY(DocumentFontFaceSet);
public: public:
static PassRefPtrWillBeRawPtr<FontFaceSet> fonts(Document&); static PassRefPtrWillBeRawPtr<FontFaceSet> fonts(Document&);
}; };
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "core/events/EventTarget.h" #include "core/events/EventTarget.h"
#include "platform/AsyncMethodRunner.h" #include "platform/AsyncMethodRunner.h"
#include "platform/RefCountedSupplement.h" #include "platform/RefCountedSupplement.h"
#include "wtf/Allocator.h"
#include "wtf/PassRefPtr.h" #include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h" #include "wtf/RefCounted.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
...@@ -117,6 +118,7 @@ private: ...@@ -117,6 +118,7 @@ private:
} }
class FontLoadHistogram { class FontLoadHistogram {
DISALLOW_ALLOCATION();
public: public:
enum Status { NoWebFonts, HadBlankText, DidNotHaveBlankText, Reported }; enum Status { NoWebFonts, HadBlankText, DidNotHaveBlankText, Reported };
FontLoadHistogram() : m_status(NoWebFonts), m_count(0), m_recorded(false) { } FontLoadHistogram() : m_status(NoWebFonts), m_count(0), m_recorded(false) { }
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#define FontSize_h #define FontSize_h
#include "core/CSSValueKeywords.h" #include "core/CSSValueKeywords.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -31,11 +32,7 @@ class Document; ...@@ -31,11 +32,7 @@ class Document;
enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimumForFontFize }; enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimumForFontFize };
class FontSize { class FontSize {
private: STATIC_ONLY(FontSize);
FontSize()
{
}
public: public:
static float getComputedSizeFromSpecifiedSize(const Document*, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize = UseSmartMinimumForFontFize); static float getComputedSizeFromSpecifiedSize(const Document*, float zoomFactor, bool isAbsoluteSize, float specifiedSize, ESmartMinimumForFontSize = UseSmartMinimumForFontFize);
......
...@@ -20,14 +20,18 @@ ...@@ -20,14 +20,18 @@
#ifndef HashTools_h #ifndef HashTools_h
#define HashTools_h #define HashTools_h
#include "wtf/Allocator.h"
namespace blink { namespace blink {
struct Property { struct Property {
DISALLOW_ALLOCATION();
int nameOffset; int nameOffset;
int id; int id;
}; };
struct Value { struct Value {
DISALLOW_ALLOCATION();
int nameOffset; int nameOffset;
int id; int id;
}; };
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define LocalFontFaceSource_h #define LocalFontFaceSource_h
#include "core/css/CSSFontFaceSource.h" #include "core/css/CSSFontFaceSource.h"
#include "wtf/Allocator.h"
#include "wtf/text/AtomicString.h" #include "wtf/text/AtomicString.h"
namespace blink { namespace blink {
...@@ -20,6 +21,7 @@ private: ...@@ -20,6 +21,7 @@ private:
PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override; PassRefPtr<SimpleFontData> createFontData(const FontDescription&) override;
class LocalFontHistograms { class LocalFontHistograms {
DISALLOW_ALLOCATION();
public: public:
LocalFontHistograms() : m_reported(false) { } LocalFontHistograms() : m_reported(false) { }
void record(bool loadSuccess); void record(bool loadSuccess);
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "core/MediaFeatureNames.h" #include "core/MediaFeatureNames.h"
#include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSPrimitiveValue.h"
#include "core/css/CSSValue.h" #include "core/css/CSSValue.h"
#include "wtf/Allocator.h"
#include "wtf/PassOwnPtr.h" #include "wtf/PassOwnPtr.h"
#include "wtf/RefPtr.h" #include "wtf/RefPtr.h"
...@@ -42,6 +43,7 @@ namespace blink { ...@@ -42,6 +43,7 @@ namespace blink {
class CSSParserToken; class CSSParserToken;
struct MediaQueryExpValue { struct MediaQueryExpValue {
DISALLOW_ALLOCATION();
CSSValueID id; CSSValueID id;
double value; double value;
CSSPrimitiveValue::UnitType unit; CSSPrimitiveValue::UnitType unit;
......
...@@ -13,6 +13,7 @@ namespace blink { ...@@ -13,6 +13,7 @@ namespace blink {
class CORE_EXPORT MediaValuesCached final : public MediaValues { class CORE_EXPORT MediaValuesCached final : public MediaValues {
public: public:
struct MediaValuesCachedData { struct MediaValuesCachedData {
DISALLOW_ALLOCATION();
// Members variables must be thread safe, since they're copied to the parser thread // Members variables must be thread safe, since they're copied to the parser thread
int viewportWidth; int viewportWidth;
int viewportHeight; int viewportHeight;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "core/css/CSSFontFaceSource.h" #include "core/css/CSSFontFaceSource.h"
#include "core/fetch/FontResource.h" #include "core/fetch/FontResource.h"
#include "core/fetch/ResourcePtr.h" #include "core/fetch/ResourcePtr.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -42,6 +43,7 @@ protected: ...@@ -42,6 +43,7 @@ protected:
private: private:
class FontLoadHistograms { class FontLoadHistograms {
DISALLOW_ALLOCATION();
public: public:
FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { } FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { }
void loadStarted(); void loadStarted();
......
...@@ -105,6 +105,7 @@ private: ...@@ -105,6 +105,7 @@ private:
using PseudoTypeInvalidationSetMap = WillBeHeapHashMap<CSSSelector::PseudoType, RefPtrWillBeMember<DescendantInvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned>>; using PseudoTypeInvalidationSetMap = WillBeHeapHashMap<CSSSelector::PseudoType, RefPtrWillBeMember<DescendantInvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned>>;
struct FeatureMetadata { struct FeatureMetadata {
DISALLOW_ALLOCATION();
FeatureMetadata() FeatureMetadata()
: usesFirstLineRules(false) : usesFirstLineRules(false)
, usesWindowInactiveSelector(false) , usesWindowInactiveSelector(false)
...@@ -131,6 +132,7 @@ private: ...@@ -131,6 +132,7 @@ private:
void updateInvalidationSetsForContentAttribute(const RuleData&); void updateInvalidationSetsForContentAttribute(const RuleData&);
struct InvalidationSetFeatures { struct InvalidationSetFeatures {
DISALLOW_ALLOCATION();
InvalidationSetFeatures() InvalidationSetFeatures()
: customPseudoElement(false) : customPseudoElement(false)
, hasBeforeOrAfter(false) , hasBeforeOrAfter(false)
......
...@@ -110,6 +110,7 @@ private: ...@@ -110,6 +110,7 @@ private:
}; };
struct SameSizeAsRuleData { struct SameSizeAsRuleData {
DISALLOW_ALLOCATION();
void* a; void* a;
unsigned b; unsigned b;
unsigned c; unsigned c;
......
...@@ -32,10 +32,12 @@ ...@@ -32,10 +32,12 @@
#define StyleColor_h #define StyleColor_h
#include "platform/graphics/Color.h" #include "platform/graphics/Color.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class StyleColor { class StyleColor {
DISALLOW_ALLOCATION();
public: public:
StyleColor(Color color) : m_color(color), m_currentColor(false) { } StyleColor(Color color) : m_color(color), m_currentColor(false) { }
static StyleColor currentColor() { return StyleColor(); } static StyleColor currentColor() { return StyleColor(); }
......
...@@ -59,6 +59,7 @@ private: ...@@ -59,6 +59,7 @@ private:
// NOTE: We put the StyleSheetResourceClient in a member instead of inheriting from it // NOTE: We put the StyleSheetResourceClient in a member instead of inheriting from it
// to avoid adding a vptr to StyleRuleImport. // to avoid adding a vptr to StyleRuleImport.
class ImportedStyleSheetClient final : public StyleSheetResourceClient { class ImportedStyleSheetClient final : public StyleSheetResourceClient {
DISALLOW_ALLOCATION();
public: public:
ImportedStyleSheetClient(StyleRuleImport* ownerRule) : m_ownerRule(ownerRule) { } ImportedStyleSheetClient(StyleRuleImport* ownerRule) : m_ownerRule(ownerRule) { }
~ImportedStyleSheetClient() override { } ~ImportedStyleSheetClient() override { }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "core/CSSValueKeywords.h" #include "core/CSSValueKeywords.h"
#include "platform/graphics/Color.h" #include "platform/graphics/Color.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h" #include "wtf/Forward.h"
namespace blink { namespace blink {
...@@ -16,6 +17,7 @@ namespace blink { ...@@ -16,6 +17,7 @@ namespace blink {
class CSSValue; class CSSValue;
class CSSParserFastPaths { class CSSParserFastPaths {
STATIC_ONLY(CSSParserFastPaths);
public: public:
// Parses simple values like '10px' or 'green', but makes no guarantees // Parses simple values like '10px' or 'green', but makes no guarantees
// about handling any property completely. // about handling any property completely.
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define CSSParserObserverWrapper_h #define CSSParserObserverWrapper_h
#include "core/css/parser/CSSParserObserver.h" #include "core/css/parser/CSSParserObserver.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -42,6 +43,7 @@ private: ...@@ -42,6 +43,7 @@ private:
CSSParserToken* m_firstParserToken; CSSParserToken* m_firstParserToken;
struct CommentPosition { struct CommentPosition {
ALLOW_ONLY_INLINE_ALLOCATION();
unsigned startOffset; unsigned startOffset;
unsigned endOffset; unsigned endOffset;
unsigned tokensBefore; unsigned tokensBefore;
......
...@@ -21,12 +21,14 @@ ...@@ -21,12 +21,14 @@
#ifndef CSSParserString_h #ifndef CSSParserString_h
#define CSSParserString_h #define CSSParserString_h
#include "wtf/Allocator.h"
#include "wtf/text/AtomicString.h" #include "wtf/text/AtomicString.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
namespace blink { namespace blink {
struct CSSParserString { struct CSSParserString {
STACK_ALLOCATED();
void init(const LChar* characters, unsigned length) void init(const LChar* characters, unsigned length)
{ {
m_data.characters8 = characters; m_data.characters8 = characters;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSPrimitiveValue.h"
#include "core/css/parser/CSSParserString.h" #include "core/css/parser/CSSParserString.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -64,6 +65,7 @@ enum HashTokenType { ...@@ -64,6 +65,7 @@ enum HashTokenType {
}; };
class CORE_EXPORT CSSParserToken { class CORE_EXPORT CSSParserToken {
WTF_MAKE_FAST_ALLOCATED(CSSParserToken);
public: public:
enum BlockType { enum BlockType {
NotBlock, NotBlock,
...@@ -145,6 +147,7 @@ private: ...@@ -145,6 +147,7 @@ private:
namespace WTF { namespace WTF {
template <> template <>
struct IsTriviallyMoveAssignable<blink::CSSParserToken> { struct IsTriviallyMoveAssignable<blink::CSSParserToken> {
STATIC_ONLY(IsTriviallyMoveAssignable);
static const bool value = true; static const bool value = true;
}; };
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/css/parser/CSSParserToken.h" #include "core/css/parser/CSSParserToken.h"
#include "wtf/Allocator.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
namespace blink { namespace blink {
...@@ -17,6 +18,7 @@ CORE_EXPORT extern const CSSParserToken& staticEOFToken; ...@@ -17,6 +18,7 @@ CORE_EXPORT extern const CSSParserToken& staticEOFToken;
// Accessing outside of the range will return an endless stream of EOF tokens. // Accessing outside of the range will return an endless stream of EOF tokens.
// This class refers to half-open intervals [first, last). // This class refers to half-open intervals [first, last).
class CORE_EXPORT CSSParserTokenRange { class CORE_EXPORT CSSParserTokenRange {
DISALLOW_ALLOCATION();
public: public:
CSSParserTokenRange(const Vector<CSSParserToken>& vector) CSSParserTokenRange(const Vector<CSSParserToken>& vector)
: m_first(vector.begin()) : m_first(vector.begin())
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "core/css/CSSValueList.h" #include "core/css/CSSValueList.h"
#include "core/css/parser/CSSParserString.h" #include "core/css/parser/CSSParserString.h"
#include "core/css/parser/CSSParserTokenRange.h" #include "core/css/parser/CSSParserTokenRange.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -37,6 +38,7 @@ struct CSSParserCalcFunction; ...@@ -37,6 +38,7 @@ struct CSSParserCalcFunction;
class CSSParserValueList; class CSSParserValueList;
struct CSSParserValue { struct CSSParserValue {
ALLOW_ONLY_INLINE_ALLOCATION();
CSSValueID id; CSSValueID id;
bool isInt; bool isInt;
union { union {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/css/parser/CSSParserToken.h" #include "core/css/parser/CSSParserToken.h"
#include "core/html/parser/InputStreamPreprocessor.h" #include "core/html/parser/InputStreamPreprocessor.h"
#include "wtf/Allocator.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
#include <climits> #include <climits>
...@@ -24,6 +25,7 @@ class CORE_EXPORT CSSTokenizer { ...@@ -24,6 +25,7 @@ class CORE_EXPORT CSSTokenizer {
WTF_MAKE_FAST_ALLOCATED(CSSTokenizer); WTF_MAKE_FAST_ALLOCATED(CSSTokenizer);
public: public:
class CORE_EXPORT Scope { class CORE_EXPORT Scope {
DISALLOW_ALLOCATION();
public: public:
Scope(const String&); Scope(const String&);
Scope(const String&, CSSParserObserverWrapper&); // For the inspector Scope(const String&, CSSParserObserverWrapper&); // For the inspector
......
...@@ -6,14 +6,15 @@ ...@@ -6,14 +6,15 @@
#define MediaQueryBlockWatcher_h #define MediaQueryBlockWatcher_h
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class CSSParserToken; class CSSParserToken;
class CORE_EXPORT MediaQueryBlockWatcher { class CORE_EXPORT MediaQueryBlockWatcher {
STACK_ALLOCATED();
public: public:
MediaQueryBlockWatcher(); MediaQueryBlockWatcher();
void handleToken(const CSSParserToken&); void handleToken(const CSSParserToken&);
unsigned blockLevel() const { return m_blockLevel; } unsigned blockLevel() const { return m_blockLevel; }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define AnimatedStyleBuilder_h #define AnimatedStyleBuilder_h
#include "core/CSSPropertyNames.h" #include "core/CSSPropertyNames.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -39,6 +40,7 @@ class AnimatableValue; ...@@ -39,6 +40,7 @@ class AnimatableValue;
class StyleResolverState; class StyleResolverState;
class AnimatedStyleBuilder { class AnimatedStyleBuilder {
STATIC_ONLY(AnimatedStyleBuilder);
public: public:
static void applyProperty(CSSPropertyID, StyleResolverState&, const AnimatableValue*); static void applyProperty(CSSPropertyID, StyleResolverState&, const AnimatableValue*);
}; };
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define CSSPropertyPriority_h #define CSSPropertyPriority_h
#include "core/CSSPropertyNames.h" #include "core/CSSPropertyNames.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -20,6 +21,7 @@ enum CSSPropertyPriority { ...@@ -20,6 +21,7 @@ enum CSSPropertyPriority {
template <CSSPropertyPriority priority> template <CSSPropertyPriority priority>
class CSSPropertyPriorityData { class CSSPropertyPriorityData {
STATIC_ONLY(CSSPropertyPriorityData);
public: public:
static inline CSSPropertyID first(); static inline CSSPropertyID first();
static inline CSSPropertyID last(); static inline CSSPropertyID last();
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "core/animation/css/CSSTransitionData.h" #include "core/animation/css/CSSTransitionData.h"
#include "core/style/ComputedStyleConstants.h" #include "core/style/ComputedStyleConstants.h"
#include "platform/animation/TimingFunction.h" #include "platform/animation/TimingFunction.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -37,6 +38,7 @@ class NinePieceImage; ...@@ -37,6 +38,7 @@ class NinePieceImage;
class BorderImageLengthBox; class BorderImageLengthBox;
class CSSToStyleMap { class CSSToStyleMap {
STATIC_ONLY(CSSToStyleMap);
public: public:
static void mapFillAttachment(StyleResolverState&, FillLayer*, CSSValue*); static void mapFillAttachment(StyleResolverState&, FillLayer*, CSSValue*);
static void mapFillClip(StyleResolverState&, FillLayer*, CSSValue*); static void mapFillClip(StyleResolverState&, FillLayer*, CSSValue*);
......
...@@ -37,7 +37,7 @@ class ComputedStyle; ...@@ -37,7 +37,7 @@ class ComputedStyle;
class StyleResolverState; class StyleResolverState;
class CachedMatchedProperties final : public NoBaseWillBeGarbageCollectedFinalized<CachedMatchedProperties> { class CachedMatchedProperties final : public NoBaseWillBeGarbageCollectedFinalized<CachedMatchedProperties> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CachedMatchedProperties);
public: public:
WillBeHeapVector<MatchedProperties> matchedProperties; WillBeHeapVector<MatchedProperties> matchedProperties;
RefPtr<ComputedStyle> computedStyle; RefPtr<ComputedStyle> computedStyle;
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "platform/LengthSize.h" #include "platform/LengthSize.h"
#include "platform/fonts/FontDescription.h" #include "platform/fonts/FontDescription.h"
#include "platform/text/TabSize.h" #include "platform/text/TabSize.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -48,6 +49,7 @@ class ScaleTransformOperation; ...@@ -48,6 +49,7 @@ class ScaleTransformOperation;
// Note that we assume the parser only allows valid CSSValue types. // Note that we assume the parser only allows valid CSSValue types.
class StyleBuilderConverter { class StyleBuilderConverter {
STATIC_ONLY(StyleBuilderConverter);
public: public:
static PassRefPtr<StyleReflection> convertBoxReflect(StyleResolverState&, CSSValue*); static PassRefPtr<StyleReflection> convertBoxReflect(StyleResolverState&, CSSValue*);
static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*); static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
namespace blink { namespace blink {
class StyleResolverStats { class StyleResolverStats {
WTF_MAKE_FAST_ALLOCATED(StyleResolverStats);
public: public:
static PassOwnPtr<StyleResolverStats> create() static PassOwnPtr<StyleResolverStats> create()
{ {
......
...@@ -44,6 +44,7 @@ class MutableStylePropertySet; ...@@ -44,6 +44,7 @@ class MutableStylePropertySet;
class StyleRuleViewport; class StyleRuleViewport;
class CORE_EXPORT ViewportStyleResolver : public NoBaseWillBeGarbageCollected<ViewportStyleResolver> { class CORE_EXPORT ViewportStyleResolver : public NoBaseWillBeGarbageCollected<ViewportStyleResolver> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(ViewportStyleResolver);
DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ViewportStyleResolver); DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(ViewportStyleResolver);
public: public:
static PassOwnPtrWillBeRawPtr<ViewportStyleResolver> create(Document* document) static PassOwnPtrWillBeRawPtr<ViewportStyleResolver> create(Document* document)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment