Commit 6c0ffe6c authored by tasak@google.com's avatar tasak@google.com

Make classes and structures in core/html 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/1306413003

git-svn-id: svn://svn.chromium.org/blink/trunk@201204 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 977eedd6
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
namespace blink { namespace blink {
class HTMLContentSelectFilter : public NoBaseWillBeGarbageCollectedFinalized<HTMLContentSelectFilter> { class HTMLContentSelectFilter : public NoBaseWillBeGarbageCollectedFinalized<HTMLContentSelectFilter> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(HTMLContentSelectFilter);
public: public:
virtual ~HTMLContentSelectFilter() { } virtual ~HTMLContentSelectFilter() { }
virtual bool canSelectNode(const WillBeHeapVector<RawPtrWillBeMember<Node>, 32>& siblings, int nth) const = 0; virtual bool canSelectNode(const WillBeHeapVector<RawPtrWillBeMember<Node>, 32>& siblings, int nth) const = 0;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#define HTMLDimension_h #define HTMLDimension_h
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h" #include "wtf/Forward.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
...@@ -40,6 +41,7 @@ namespace blink { ...@@ -40,6 +41,7 @@ namespace blink {
// This class corresponds to a dimension as described in HTML5 by the // This class corresponds to a dimension as described in HTML5 by the
// "rules for parsing a list of dimensions" (section 2.4.4.6). // "rules for parsing a list of dimensions" (section 2.4.4.6).
class HTMLDimension { class HTMLDimension {
ALLOW_ONLY_INLINE_ALLOCATION();
public: public:
enum HTMLDimensionType { enum HTMLDimensionType {
Relative, Percentage, Absolute Relative, Percentage, Absolute
......
...@@ -159,6 +159,7 @@ inline bool Node::hasTagName(const HTMLQualifiedName& name) const ...@@ -159,6 +159,7 @@ inline bool Node::hasTagName(const HTMLQualifiedName& name) const
// Functor used to match HTMLElements with a specific HTML tag when using the ElementTraversal API. // Functor used to match HTMLElements with a specific HTML tag when using the ElementTraversal API.
class HasHTMLTagName { class HasHTMLTagName {
STACK_ALLOCATED();
public: public:
explicit HasHTMLTagName(const HTMLQualifiedName& tagName): m_tagName(tagName) { } explicit HasHTMLTagName(const HTMLQualifiedName& tagName): m_tagName(tagName) { }
bool operator() (const HTMLElement& element) const { return element.hasTagName(m_tagName); } bool operator() (const HTMLElement& element) const { return element.hasTagName(m_tagName); }
......
...@@ -67,6 +67,7 @@ public: ...@@ -67,6 +67,7 @@ public:
Widget* ownedWidget() const; Widget* ownedWidget() const;
class UpdateSuspendScope { class UpdateSuspendScope {
STACK_ALLOCATED();
public: public:
UpdateSuspendScope(); UpdateSuspendScope();
~UpdateSuspendScope(); ~UpdateSuspendScope();
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef HTMLImageFallbackHelper_h #ifndef HTMLImageFallbackHelper_h
#define HTMLImageFallbackHelper_h #define HTMLImageFallbackHelper_h
#include "wtf/Allocator.h"
#include "wtf/PassRefPtr.h" #include "wtf/PassRefPtr.h"
namespace blink { namespace blink {
...@@ -13,6 +14,7 @@ class Element; ...@@ -13,6 +14,7 @@ class Element;
class ComputedStyle; class ComputedStyle;
class HTMLImageFallbackHelper { class HTMLImageFallbackHelper {
STATIC_ONLY(HTMLImageFallbackHelper);
public: public:
static void createAltTextShadowTree(Element&); static void createAltTextShadowTree(Element&);
static PassRefPtr<ComputedStyle> customStyleForAltText(Element&, PassRefPtr<ComputedStyle> newStyle); static PassRefPtr<ComputedStyle> customStyleForAltText(Element&, PassRefPtr<ComputedStyle> newStyle);
......
...@@ -34,11 +34,13 @@ ...@@ -34,11 +34,13 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/dom/IconURL.h" #include "core/dom/IconURL.h"
#include "wtf/Allocator.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
namespace blink { namespace blink {
class CORE_EXPORT LinkRelAttribute { class CORE_EXPORT LinkRelAttribute {
DISALLOW_ALLOCATION();
public: public:
explicit LinkRelAttribute(const String& = ""); explicit LinkRelAttribute(const String& = "");
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define MediaFragmentURIParser_h #define MediaFragmentURIParser_h
#include "platform/weborigin/KURL.h" #include "platform/weborigin/KURL.h"
#include "wtf/Allocator.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
namespace blink { namespace blink {
...@@ -34,6 +35,7 @@ namespace blink { ...@@ -34,6 +35,7 @@ namespace blink {
class KURL; class KURL;
class MediaFragmentURIParser final { class MediaFragmentURIParser final {
STACK_ALLOCATED();
public: public:
MediaFragmentURIParser(const KURL&); MediaFragmentURIParser(const KURL&);
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "public/platform/WebTimeRange.h" #include "public/platform/WebTimeRange.h"
#include "wtf/Allocator.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
#include <algorithm> #include <algorithm>
...@@ -43,6 +44,7 @@ class CORE_EXPORT TimeRanges : public GarbageCollectedFinalized<TimeRanges>, pub ...@@ -43,6 +44,7 @@ class CORE_EXPORT TimeRanges : public GarbageCollectedFinalized<TimeRanges>, pub
public: public:
// We consider all the Ranges to be semi-bounded as follow: [start, end[ // We consider all the Ranges to be semi-bounded as follow: [start, end[
struct Range { struct Range {
ALLOW_ONLY_INLINE_ALLOCATION();
public: public:
Range() { } Range() { }
Range(double start, double end) Range(double start, double end)
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "core/dom/Document.h" #include "core/dom/Document.h"
#include "core/html/canvas/CanvasContextCreationAttributes.h" #include "core/html/canvas/CanvasContextCreationAttributes.h"
#include "core/html/canvas/CanvasRenderingContext.h" #include "core/html/canvas/CanvasRenderingContext.h"
#include "wtf/Allocator.h"
#include "wtf/PassRefPtr.h" #include "wtf/PassRefPtr.h"
namespace blink { namespace blink {
...@@ -16,7 +17,10 @@ namespace blink { ...@@ -16,7 +17,10 @@ namespace blink {
class HTMLCanvasElement; class HTMLCanvasElement;
class CORE_EXPORT CanvasRenderingContextFactory { class CORE_EXPORT CanvasRenderingContextFactory {
WTF_MAKE_FAST_ALLOCATED(CanvasRenderingContextFactory);
WTF_MAKE_NONCOPYABLE(CanvasRenderingContextFactory);
public: public:
CanvasRenderingContextFactory() = default;
virtual ~CanvasRenderingContextFactory() { } virtual ~CanvasRenderingContextFactory() { }
virtual PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&, Document&) = 0; virtual PassOwnPtrWillBeRawPtr<CanvasRenderingContext> create(HTMLCanvasElement*, const CanvasContextCreationAttributes&, Document&) = 0;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/geometry/IntRect.h" #include "platform/geometry/IntRect.h"
#include "wtf/Allocator.h"
#include "wtf/RefCounted.h" #include "wtf/RefCounted.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
...@@ -41,12 +42,14 @@ namespace blink { ...@@ -41,12 +42,14 @@ namespace blink {
class AXObject; class AXObject;
struct DateTimeSuggestion { struct DateTimeSuggestion {
ALLOW_ONLY_INLINE_ALLOCATION();
double value; double value;
String localizedValue; String localizedValue;
String label; String label;
}; };
struct DateTimeChooserParameters { struct DateTimeChooserParameters {
DISALLOW_ALLOCATION();
AtomicString type; AtomicString type;
IntRect anchorRectInRootFrame; IntRect anchorRectInRootFrame;
IntRect anchorRectInScreen; IntRect anchorRectInScreen;
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class FormControlState; class FormControlState;
...@@ -39,6 +41,7 @@ class FormControlState; ...@@ -39,6 +41,7 @@ class FormControlState;
// Each field can contain invalid value for date, e.g. day of month field can // Each field can contain invalid value for date, e.g. day of month field can
// be 30 even if month field is February. // be 30 even if month field is February.
class DateTimeFieldsState { class DateTimeFieldsState {
STACK_ALLOCATED();
public: public:
enum AMPMValue { enum AMPMValue {
AMPMValueEmpty = -1, AMPMValueEmpty = -1,
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include "core/html/forms/RadioButtonGroupScope.h" #include "core/html/forms/RadioButtonGroupScope.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h" #include "wtf/Forward.h"
#include "wtf/ListHashSet.h" #include "wtf/ListHashSet.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
...@@ -37,6 +38,7 @@ class HTMLFormElement; ...@@ -37,6 +38,7 @@ class HTMLFormElement;
class SavedFormState; class SavedFormState;
class FormControlState { class FormControlState {
ALLOW_ONLY_INLINE_ALLOCATION();
public: public:
FormControlState() : m_type(TypeSkip) { } FormControlState() : m_type(TypeSkip) { }
explicit FormControlState(const String& value) : m_type(TypeRestore) { m_values.append(value); } explicit FormControlState(const String& value) : m_type(TypeRestore) { m_values.append(value); }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#define StepRange_h #define StepRange_h
#include "platform/Decimal.h" #include "platform/Decimal.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h" #include "wtf/Forward.h"
namespace blink { namespace blink {
...@@ -29,6 +30,7 @@ namespace blink { ...@@ -29,6 +30,7 @@ namespace blink {
enum AnyStepHandling { RejectAny, AnyIsDefaultStep }; enum AnyStepHandling { RejectAny, AnyIsDefaultStep };
class StepRange { class StepRange {
DISALLOW_ALLOCATION();
public: public:
enum StepValueShouldBe { enum StepValueShouldBe {
StepValueShouldBeReal, StepValueShouldBeReal,
...@@ -101,7 +103,7 @@ public: ...@@ -101,7 +103,7 @@ public:
} }
private: private:
StepRange& operator =(const StepRange&); StepRange& operator=(const StepRange&) = delete;
Decimal acceptableError() const; Decimal acceptableError() const;
Decimal roundByStep(const Decimal& value, const Decimal& base) const; Decimal roundByStep(const Decimal& value, const Decimal& base) const;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/dom/DOMTimeStamp.h" #include "core/dom/DOMTimeStamp.h"
#include "wtf/Allocator.h"
#include "wtf/text/StringBuilder.h" #include "wtf/text/StringBuilder.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
...@@ -45,6 +46,7 @@ public: ...@@ -45,6 +46,7 @@ public:
}; };
class TypeAhead { class TypeAhead {
DISALLOW_ALLOCATION();
public: public:
TypeAhead(TypeAheadDataSource*); TypeAhead(TypeAheadDataSource*);
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "core/html/imports/HTMLImportState.h" #include "core/html/imports/HTMLImportState.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
#include "wtf/TreeNode.h" #include "wtf/TreeNode.h"
namespace blink { namespace blink {
...@@ -91,6 +92,7 @@ class HTMLImportLoader; ...@@ -91,6 +92,7 @@ class HTMLImportLoader;
// The superclass of HTMLImportTreeRoot and HTMLImportChild // The superclass of HTMLImportTreeRoot and HTMLImportChild
// This represents the import tree data structure. // This represents the import tree data structure.
class HTMLImport : public NoBaseWillBeGarbageCollectedFinalized<HTMLImport>, public TreeNode<HTMLImport> { class HTMLImport : public NoBaseWillBeGarbageCollectedFinalized<HTMLImport>, public TreeNode<HTMLImport> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(HTMLImport);
public: public:
enum SyncMode { enum SyncMode {
Sync = 0, Sync = 0,
......
...@@ -56,6 +56,7 @@ class HTMLImportsController; ...@@ -56,6 +56,7 @@ class HTMLImportsController;
// //
class HTMLImportLoader final : public NoBaseWillBeGarbageCollectedFinalized<HTMLImportLoader>, public ResourceOwner<RawResource>, public DocumentParserClient { class HTMLImportLoader final : public NoBaseWillBeGarbageCollectedFinalized<HTMLImportLoader>, public ResourceOwner<RawResource>, public DocumentParserClient {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLImportLoader); WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLImportLoader);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(HTMLImportLoader);
public: public:
enum State { enum State {
StateLoading, StateLoading,
......
...@@ -31,11 +31,13 @@ ...@@ -31,11 +31,13 @@
#ifndef HTMLImportState_h #ifndef HTMLImportState_h
#define HTMLImportState_h #define HTMLImportState_h
#include "wtf/Allocator.h"
#include "wtf/Assertions.h" #include "wtf/Assertions.h"
namespace blink { namespace blink {
class HTMLImportState { class HTMLImportState {
DISALLOW_ALLOCATION();
public: public:
enum Value { enum Value {
BlockingScriptExecution = 0, BlockingScriptExecution = 0,
......
...@@ -30,12 +30,14 @@ ...@@ -30,12 +30,14 @@
#include "core/dom/Attribute.h" #include "core/dom/Attribute.h"
#include "core/html/parser/CompactHTMLToken.h" #include "core/html/parser/CompactHTMLToken.h"
#include "core/html/parser/HTMLToken.h" #include "core/html/parser/HTMLToken.h"
#include "wtf/Allocator.h"
#include "wtf/RefCounted.h" #include "wtf/RefCounted.h"
#include "wtf/RefPtr.h" #include "wtf/RefPtr.h"
namespace blink { namespace blink {
class AtomicHTMLToken { class AtomicHTMLToken {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(AtomicHTMLToken); WTF_MAKE_NONCOPYABLE(AtomicHTMLToken);
public: public:
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define BackgroundHTMLInputStream_h #define BackgroundHTMLInputStream_h
#include "platform/text/SegmentedString.h" #include "platform/text/SegmentedString.h"
#include "wtf/Allocator.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
...@@ -35,6 +36,7 @@ namespace blink { ...@@ -35,6 +36,7 @@ namespace blink {
typedef size_t HTMLInputCheckpoint; typedef size_t HTMLInputCheckpoint;
class BackgroundHTMLInputStream { class BackgroundHTMLInputStream {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(BackgroundHTMLInputStream); WTF_MAKE_NONCOPYABLE(BackgroundHTMLInputStream);
public: public:
BackgroundHTMLInputStream(); BackgroundHTMLInputStream();
......
...@@ -46,8 +46,11 @@ class WebScheduler; ...@@ -46,8 +46,11 @@ class WebScheduler;
class BackgroundHTMLParser { class BackgroundHTMLParser {
WTF_MAKE_FAST_ALLOCATED(BackgroundHTMLParser); WTF_MAKE_FAST_ALLOCATED(BackgroundHTMLParser);
WTF_MAKE_NONCOPYABLE(BackgroundHTMLParser);
public: public:
struct Configuration { struct Configuration {
WTF_MAKE_FAST_ALLOCATED(Configuration);
public:
Configuration(); Configuration();
HTMLParserOptions options; HTMLParserOptions options;
WeakPtr<HTMLDocumentParser> parser; WeakPtr<HTMLDocumentParser> parser;
...@@ -63,6 +66,8 @@ public: ...@@ -63,6 +66,8 @@ public:
static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, WebScheduler*); static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, WebScheduler*);
struct Checkpoint { struct Checkpoint {
WTF_MAKE_FAST_ALLOCATED(CheckPoint);
public:
WeakPtr<HTMLDocumentParser> parser; WeakPtr<HTMLDocumentParser> parser;
OwnPtr<HTMLToken> token; OwnPtr<HTMLToken> token;
OwnPtr<HTMLTokenizer> tokenizer; OwnPtr<HTMLTokenizer> tokenizer;
......
...@@ -36,6 +36,7 @@ namespace blink { ...@@ -36,6 +36,7 @@ namespace blink {
class SegmentedString; class SegmentedString;
class CSSPreloadScanner { class CSSPreloadScanner {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(CSSPreloadScanner); WTF_MAKE_NONCOPYABLE(CSSPreloadScanner);
public: public:
CSSPreloadScanner(); CSSPreloadScanner();
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define CompactHTMLToken_h #define CompactHTMLToken_h
#include "core/html/parser/HTMLToken.h" #include "core/html/parser/HTMLToken.h"
#include "wtf/Allocator.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
#include "wtf/text/TextPosition.h" #include "wtf/text/TextPosition.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
...@@ -36,8 +37,10 @@ namespace blink { ...@@ -36,8 +37,10 @@ namespace blink {
class QualifiedName; class QualifiedName;
class CompactHTMLToken { class CompactHTMLToken {
ALLOW_ONLY_INLINE_ALLOCATION();
public: public:
struct Attribute { struct Attribute {
ALLOW_ONLY_INLINE_ALLOCATION();
Attribute(const String& name, const String& value) Attribute(const String& name, const String& value)
: name(name) : name(name)
, value(value) , value(value)
......
...@@ -202,6 +202,7 @@ public: ...@@ -202,6 +202,7 @@ public:
ParserContentPolicy parserContentPolicy() { return m_parserContentPolicy; } ParserContentPolicy parserContentPolicy() { return m_parserContentPolicy; }
class RedirectToFosterParentGuard { class RedirectToFosterParentGuard {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(RedirectToFosterParentGuard); WTF_MAKE_NONCOPYABLE(RedirectToFosterParentGuard);
public: public:
RedirectToFosterParentGuard(HTMLConstructionSite& tree) RedirectToFosterParentGuard(HTMLConstructionSite& tree)
......
...@@ -92,6 +92,8 @@ public: ...@@ -92,6 +92,8 @@ public:
void resumeScheduledTasks() final; void resumeScheduledTasks() final;
struct ParsedChunk { struct ParsedChunk {
WTF_MAKE_FAST_ALLOCATED(ParsedChunk);
public:
OwnPtr<CompactHTMLTokenStream> tokens; OwnPtr<CompactHTMLTokenStream> tokens;
PreloadRequestStream preloads; PreloadRequestStream preloads;
XSSInfoStream xssInfos; XSSInfoStream xssInfos;
......
...@@ -28,10 +28,12 @@ ...@@ -28,10 +28,12 @@
#define HTMLEntityParser_h #define HTMLEntityParser_h
#include "platform/text/SegmentedString.h" #include "platform/text/SegmentedString.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class DecodedHTMLEntity { class DecodedHTMLEntity {
STACK_ALLOCATED();
private: private:
// HTML entities contain at most four UTF-16 code units. // HTML entities contain at most four UTF-16 code units.
static const unsigned kMaxLength = 4; static const unsigned kMaxLength = 4;
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#ifndef HTMLEntitySearch_h #ifndef HTMLEntitySearch_h
#define HTMLEntitySearch_h #define HTMLEntitySearch_h
#include "wtf/Allocator.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
namespace blink { namespace blink {
...@@ -33,6 +34,7 @@ namespace blink { ...@@ -33,6 +34,7 @@ namespace blink {
struct HTMLEntityTableEntry; struct HTMLEntityTableEntry;
class HTMLEntitySearch { class HTMLEntitySearch {
STACK_ALLOCATED();
public: public:
HTMLEntitySearch(); HTMLEntitySearch();
......
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
#ifndef HTMLEntityTable_h #ifndef HTMLEntityTable_h
#define HTMLEntityTable_h #define HTMLEntityTable_h
#include "wtf/Allocator.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
namespace blink { namespace blink {
// Member order to optimize packing. There will be thousands of these objects. // Member order to optimize packing. There will be thousands of these objects.
struct HTMLEntityTableEntry { struct HTMLEntityTableEntry {
DISALLOW_ALLOCATION();
LChar lastCharacter() const; LChar lastCharacter() const;
UChar32 firstValue; UChar32 firstValue;
...@@ -41,6 +43,7 @@ struct HTMLEntityTableEntry { ...@@ -41,6 +43,7 @@ struct HTMLEntityTableEntry {
}; };
class HTMLEntityTable { class HTMLEntityTable {
STATIC_ONLY(HTMLEntityTable);
public: public:
static const HTMLEntityTableEntry* firstEntry(); static const HTMLEntityTableEntry* firstEntry();
static const HTMLEntityTableEntry* lastEntry(); static const HTMLEntityTableEntry* lastEntry();
......
...@@ -84,6 +84,7 @@ public: ...@@ -84,6 +84,7 @@ public:
}; };
class Bookmark { class Bookmark {
STACK_ALLOCATED();
public: public:
explicit Bookmark(Entry* entry) explicit Bookmark(Entry* entry)
: m_hasBeenMoved(false) : m_hasBeenMoved(false)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "core/html/parser/InputStreamPreprocessor.h" #include "core/html/parser/InputStreamPreprocessor.h"
#include "platform/text/SegmentedString.h" #include "platform/text/SegmentedString.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -49,6 +50,7 @@ namespace blink { ...@@ -49,6 +50,7 @@ namespace blink {
// The network adds data at the end of the InputStream, which appends // The network adds data at the end of the InputStream, which appends
// them to the "last" string. // them to the "last" string.
class HTMLInputStream { class HTMLInputStream {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(HTMLInputStream); WTF_MAKE_NONCOPYABLE(HTMLInputStream);
public: public:
HTMLInputStream() HTMLInputStream()
...@@ -124,6 +126,7 @@ private: ...@@ -124,6 +126,7 @@ private:
}; };
class InsertionPointRecord { class InsertionPointRecord {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(InsertionPointRecord); WTF_MAKE_NONCOPYABLE(InsertionPointRecord);
public: public:
explicit InsertionPointRecord(HTMLInputStream& inputStream) explicit InsertionPointRecord(HTMLInputStream& inputStream)
......
...@@ -27,12 +27,14 @@ ...@@ -27,12 +27,14 @@
#define HTMLParserOptions_h #define HTMLParserOptions_h
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class Document; class Document;
class CORE_EXPORT HTMLParserOptions { class CORE_EXPORT HTMLParserOptions {
DISALLOW_ALLOCATION();
public: public:
bool scriptEnabled; bool scriptEnabled;
bool pluginsEnabled; bool pluginsEnabled;
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "core/html/parser/NestingLevelIncrementer.h" #include "core/html/parser/NestingLevelIncrementer.h"
#include "platform/scheduler/CancellableTaskFactory.h" #include "platform/scheduler/CancellableTaskFactory.h"
#include "wtf/Allocator.h"
#include "wtf/PassOwnPtr.h" #include "wtf/PassOwnPtr.h"
#include "wtf/RefPtr.h" #include "wtf/RefPtr.h"
...@@ -54,6 +55,7 @@ public: ...@@ -54,6 +55,7 @@ public:
}; };
class SpeculationsPumpSession : public ActiveParserSession { class SpeculationsPumpSession : public ActiveParserSession {
STACK_ALLOCATED();
public: public:
SpeculationsPumpSession(unsigned& nestingLevel, Document*); SpeculationsPumpSession(unsigned& nestingLevel, Document*);
~SpeculationsPumpSession(); ~SpeculationsPumpSession();
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/WebThreadSupportingGC.h" #include "platform/WebThreadSupportingGC.h"
#include "wtf/Allocator.h"
#include "wtf/Functional.h" #include "wtf/Functional.h"
#include "wtf/OwnPtr.h" #include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h" #include "wtf/PassOwnPtr.h"
...@@ -40,6 +41,7 @@ ...@@ -40,6 +41,7 @@
namespace blink { namespace blink {
class CORE_EXPORT HTMLParserThread { class CORE_EXPORT HTMLParserThread {
WTF_MAKE_FAST_ALLOCATED(HTMLParserThread);
public: public:
static void init(); static void init();
static void shutdown(); static void shutdown();
......
...@@ -46,6 +46,8 @@ class HTMLTokenizer; ...@@ -46,6 +46,8 @@ class HTMLTokenizer;
class SegmentedString; class SegmentedString;
struct CORE_EXPORT CachedDocumentParameters { struct CORE_EXPORT CachedDocumentParameters {
WTF_MAKE_FAST_ALLOCATED(CachedDocumentParameters);
public:
static PassOwnPtr<CachedDocumentParameters> create(Document* document, PassRefPtrWillBeRawPtr<MediaValues> mediaValues = nullptr) static PassOwnPtr<CachedDocumentParameters> create(Document* document, PassRefPtrWillBeRawPtr<MediaValues> mediaValues = nullptr)
{ {
return adoptPtr(new CachedDocumentParameters(document, mediaValues)); return adoptPtr(new CachedDocumentParameters(document, mediaValues));
......
...@@ -28,12 +28,14 @@ ...@@ -28,12 +28,14 @@
#include "core/html/parser/HTMLToken.h" #include "core/html/parser/HTMLToken.h"
#include "platform/text/SegmentedString.h" #include "platform/text/SegmentedString.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class HTMLTokenizer; class HTMLTokenizer;
class HTMLSourceTracker { class HTMLSourceTracker {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(HTMLSourceTracker); WTF_MAKE_NONCOPYABLE(HTMLSourceTracker);
public: public:
HTMLSourceTracker(); HTMLSourceTracker();
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#define HTMLSrcsetParser_h #define HTMLSrcsetParser_h
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "wtf/Allocator.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
namespace blink { namespace blink {
...@@ -42,6 +43,7 @@ class Document; ...@@ -42,6 +43,7 @@ class Document;
enum { UninitializedDescriptor = -1 }; enum { UninitializedDescriptor = -1 };
class DescriptorParsingResult { class DescriptorParsingResult {
STACK_ALLOCATED();
public: public:
DescriptorParsingResult() DescriptorParsingResult()
: m_density(UninitializedDescriptor) : m_density(UninitializedDescriptor)
...@@ -69,6 +71,7 @@ private: ...@@ -69,6 +71,7 @@ private:
}; };
class ImageCandidate { class ImageCandidate {
ALLOW_ONLY_INLINE_ALLOCATION();
public: public:
enum OriginAttribute { enum OriginAttribute {
SrcsetOrigin, SrcsetOrigin,
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
namespace blink { namespace blink {
class DoctypeData { class DoctypeData {
WTF_MAKE_FAST_ALLOCATED(DoctypeData);
WTF_MAKE_NONCOPYABLE(DoctypeData); WTF_MAKE_NONCOPYABLE(DoctypeData);
public: public:
DoctypeData() DoctypeData()
...@@ -74,8 +75,10 @@ public: ...@@ -74,8 +75,10 @@ public:
}; };
class Attribute { class Attribute {
ALLOW_ONLY_INLINE_ALLOCATION();
public: public:
class Range { class Range {
DISALLOW_ALLOCATION();
public: public:
int start; int start;
int end; int end;
......
...@@ -122,6 +122,7 @@ public: ...@@ -122,6 +122,7 @@ public:
}; };
struct Checkpoint { struct Checkpoint {
STACK_ALLOCATED();
HTMLParserOptions options; HTMLParserOptions options;
State state; State state;
UChar additionalAllowedCharacter; UChar additionalAllowedCharacter;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#define InputStreamPreprocessor_h #define InputStreamPreprocessor_h
#include "platform/text/SegmentedString.h" #include "platform/text/SegmentedString.h"
#include "wtf/Allocator.h"
#include "wtf/Noncopyable.h" #include "wtf/Noncopyable.h"
namespace blink { namespace blink {
...@@ -38,6 +39,7 @@ const LChar kEndOfFileMarker = 0; ...@@ -38,6 +39,7 @@ const LChar kEndOfFileMarker = 0;
// http://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream // http://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream
template <typename Tokenizer> template <typename Tokenizer>
class InputStreamPreprocessor { class InputStreamPreprocessor {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(InputStreamPreprocessor); WTF_MAKE_NONCOPYABLE(InputStreamPreprocessor);
public: public:
InputStreamPreprocessor(Tokenizer* tokenizer) InputStreamPreprocessor(Tokenizer* tokenizer)
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "core/fetch/FetchRequest.h" #include "core/fetch/FetchRequest.h"
#include "core/fetch/Resource.h" #include "core/fetch/Resource.h"
#include "platform/weborigin/SecurityPolicy.h" #include "platform/weborigin/SecurityPolicy.h"
#include "wtf/Allocator.h"
#include "wtf/text/TextPosition.h" #include "wtf/text/TextPosition.h"
namespace blink { namespace blink {
...@@ -16,6 +17,7 @@ namespace blink { ...@@ -16,6 +17,7 @@ namespace blink {
class Document; class Document;
class PreloadRequest { class PreloadRequest {
WTF_MAKE_FAST_ALLOCATED(PreloadRequest);
public: public:
enum RequestType { RequestTypePreload, RequestTypePreconnect }; enum RequestType { RequestTypePreload, RequestTypePreconnect };
......
...@@ -32,6 +32,8 @@ namespace blink { ...@@ -32,6 +32,8 @@ namespace blink {
class HTMLMetaCharsetParser; class HTMLMetaCharsetParser;
class CORE_EXPORT TextResourceDecoder { class CORE_EXPORT TextResourceDecoder {
WTF_MAKE_FAST_ALLOCATED(TextResourceDecoder);
WTF_MAKE_NONCOPYABLE(TextResourceDecoder);
public: public:
enum EncodingSource { enum EncodingSource {
DefaultEncoding, DefaultEncoding,
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "platform/network/HTTPParsers.h" #include "platform/network/HTTPParsers.h"
#include "platform/text/SuffixTree.h" #include "platform/text/SuffixTree.h"
#include "platform/weborigin/KURL.h" #include "platform/weborigin/KURL.h"
#include "wtf/Allocator.h"
#include "wtf/PassOwnPtr.h" #include "wtf/PassOwnPtr.h"
#include "wtf/text/TextEncoding.h" #include "wtf/text/TextEncoding.h"
...@@ -41,6 +42,7 @@ class XSSInfo; ...@@ -41,6 +42,7 @@ class XSSInfo;
class XSSAuditorDelegate; class XSSAuditorDelegate;
struct FilterTokenRequest { struct FilterTokenRequest {
STACK_ALLOCATED();
FilterTokenRequest(HTMLToken& token, HTMLSourceTracker& sourceTracker, bool shouldAllowCDATA) FilterTokenRequest(HTMLToken& token, HTMLSourceTracker& sourceTracker, bool shouldAllowCDATA)
: token(token) : token(token)
, sourceTracker(sourceTracker) , sourceTracker(sourceTracker)
...@@ -53,6 +55,7 @@ struct FilterTokenRequest { ...@@ -53,6 +55,7 @@ struct FilterTokenRequest {
}; };
class XSSAuditor { class XSSAuditor {
WTF_MAKE_FAST_ALLOCATED(XSSAuditor);
WTF_MAKE_NONCOPYABLE(XSSAuditor); WTF_MAKE_NONCOPYABLE(XSSAuditor);
public: public:
XSSAuditor(); XSSAuditor();
......
...@@ -40,6 +40,8 @@ class Document; ...@@ -40,6 +40,8 @@ class Document;
class FormData; class FormData;
class XSSInfo { class XSSInfo {
WTF_MAKE_FAST_ALLOCATED(XSSInfo);
WTF_MAKE_NONCOPYABLE(XSSInfo);
public: public:
static PassOwnPtr<XSSInfo> create(const String& originalURL, bool didBlockEntirePage, bool didSendXSSProtectionHeader, bool didSendCSPHeader) static PassOwnPtr<XSSInfo> create(const String& originalURL, bool didBlockEntirePage, bool didSendXSSProtectionHeader, bool didSendCSPHeader)
{ {
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "core/html/forms/StepRange.h" #include "core/html/forms/StepRange.h"
#include "core/html/shadow/DateTimeFieldElement.h" #include "core/html/shadow/DateTimeFieldElement.h"
#include "platform/DateComponents.h" #include "platform/DateComponents.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -62,6 +63,7 @@ public: ...@@ -62,6 +63,7 @@ public:
}; };
struct LayoutParameters { struct LayoutParameters {
STACK_ALLOCATED();
String dateTimeFormat; String dateTimeFormat;
String fallbackDateTimeFormat; String fallbackDateTimeFormat;
Locale& locale; Locale& locale;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
#include "core/html/shadow/DateTimeNumericFieldElement.h" #include "core/html/shadow/DateTimeNumericFieldElement.h"
#include "core/html/shadow/DateTimeSymbolicFieldElement.h" #include "core/html/shadow/DateTimeSymbolicFieldElement.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -226,6 +227,7 @@ class DateTimeYearFieldElement final : public DateTimeNumericFieldElement { ...@@ -226,6 +227,7 @@ class DateTimeYearFieldElement final : public DateTimeNumericFieldElement {
public: public:
struct Parameters { struct Parameters {
STACK_ALLOCATED();
int minimumYear; int minimumYear;
int maximumYear; int maximumYear;
bool minIsSpecified; bool minIsSpecified;
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI) #if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
#include "core/html/shadow/DateTimeFieldElement.h" #include "core/html/shadow/DateTimeFieldElement.h"
#include "wtf/Allocator.h"
#include "wtf/text/StringBuilder.h" #include "wtf/text/StringBuilder.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
...@@ -46,12 +47,14 @@ class DateTimeNumericFieldElement : public DateTimeFieldElement { ...@@ -46,12 +47,14 @@ class DateTimeNumericFieldElement : public DateTimeFieldElement {
public: public:
struct Step { struct Step {
DISALLOW_ALLOCATION();
Step(int step = 1, int stepBase = 0) : step(step), stepBase(stepBase) { } Step(int step = 1, int stepBase = 0) : step(step), stepBase(stepBase) { }
int step; int step;
int stepBase; int stepBase;
}; };
struct Range { struct Range {
DISALLOW_ALLOCATION();
Range(int minimum, int maximum) : minimum(minimum), maximum(maximum) { } Range(int minimum, int maximum) : minimum(minimum), maximum(maximum) { }
int clampValue(int) const; int clampValue(int) const;
bool isInRange(int) const; bool isInRange(int) const;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "core/html/track/TextTrackKindUserPreference.h" #include "core/html/track/TextTrackKindUserPreference.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -17,6 +18,7 @@ class AutomaticTrackSelection { ...@@ -17,6 +18,7 @@ class AutomaticTrackSelection {
STACK_ALLOCATED(); STACK_ALLOCATED();
public: public:
struct Configuration { struct Configuration {
DISALLOW_ALLOCATION();
Configuration() Configuration()
: disableCurrentlyEnabledTracks(false) : disableCurrentlyEnabledTracks(false)
, forceEnableSubtitleOrCaptionTrack(false) , forceEnableSubtitleOrCaptionTrack(false)
......
...@@ -28,7 +28,8 @@ typedef Vector<CueInterval> CueList; ...@@ -28,7 +28,8 @@ typedef Vector<CueInterval> CueList;
// This class manages the timeline and rendering updates of cues associated // This class manages the timeline and rendering updates of cues associated
// with TextTracks. Owned by a HTMLMediaElement. // with TextTracks. Owned by a HTMLMediaElement.
class CueTimeline : public NoBaseWillBeGarbageCollectedFinalized<CueTimeline> { class CueTimeline final : public NoBaseWillBeGarbageCollectedFinalized<CueTimeline> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CueTimeline);
public: public:
CueTimeline(HTMLMediaElement&); CueTimeline(HTMLMediaElement&);
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/text/SegmentedString.h" #include "platform/text/SegmentedString.h"
#include "wtf/Allocator.h"
#include "wtf/text/StringBuilder.h" #include "wtf/text/StringBuilder.h"
namespace blink { namespace blink {
...@@ -44,6 +45,7 @@ namespace blink { ...@@ -44,6 +45,7 @@ namespace blink {
// to 'REPLACEMENT CHARACTER' (U+FFFD) and does not return the linebreaks as // to 'REPLACEMENT CHARACTER' (U+FFFD) and does not return the linebreaks as
// part of the result. // part of the result.
class CORE_EXPORT BufferedLineReader { class CORE_EXPORT BufferedLineReader {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(BufferedLineReader); WTF_MAKE_NONCOPYABLE(BufferedLineReader);
public: public:
BufferedLineReader() BufferedLineReader()
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "core/html/track/TextTrackCue.h" #include "core/html/track/TextTrackCue.h"
#include "platform/heap/Handle.h" #include "platform/heap/Handle.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
...@@ -42,6 +43,7 @@ class VTTCue; ...@@ -42,6 +43,7 @@ class VTTCue;
class VTTScanner; class VTTScanner;
struct VTTDisplayParameters { struct VTTDisplayParameters {
STACK_ALLOCATED();
VTTDisplayParameters(); VTTDisplayParameters();
FloatPoint position; FloatPoint position;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/ParsingUtilities.h" #include "platform/ParsingUtilities.h"
#include "wtf/Allocator.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
namespace blink { namespace blink {
...@@ -48,6 +49,7 @@ namespace blink { ...@@ -48,6 +49,7 @@ namespace blink {
// The 'scan' operation performs a 'match', and if the match is successful it // The 'scan' operation performs a 'match', and if the match is successful it
// advance the input pointer past the matched sequence. // advance the input pointer past the matched sequence.
class CORE_EXPORT VTTScanner { class CORE_EXPORT VTTScanner {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(VTTScanner); WTF_MAKE_NONCOPYABLE(VTTScanner);
public: public:
explicit VTTScanner(const String& line); explicit VTTScanner(const String& line);
...@@ -55,6 +57,7 @@ public: ...@@ -55,6 +57,7 @@ public:
typedef const LChar* Position; typedef const LChar* Position;
class Run { class Run {
STACK_ALLOCATED();
public: public:
Run(Position start, Position end, bool is8Bit) Run(Position start, Position end, bool is8Bit)
: m_start(start), m_end(end), m_is8Bit(is8Bit) { } : m_start(start), m_end(end), m_is8Bit(is8Bit) { }
......
...@@ -31,9 +31,12 @@ ...@@ -31,9 +31,12 @@
#ifndef VTTToken_h #ifndef VTTToken_h
#define VTTToken_h #define VTTToken_h
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class VTTTokenTypes { class VTTTokenTypes {
STATIC_ONLY(VTTTokenTypes);
public: public:
enum Type { enum Type {
Uninitialized, Uninitialized,
...@@ -45,6 +48,7 @@ public: ...@@ -45,6 +48,7 @@ public:
}; };
class VTTToken { class VTTToken {
STACK_ALLOCATED();
public: public:
typedef VTTTokenTypes Type; typedef VTTTokenTypes Type;
......
...@@ -33,10 +33,12 @@ ...@@ -33,10 +33,12 @@
#include "core/html/parser/InputStreamPreprocessor.h" #include "core/html/parser/InputStreamPreprocessor.h"
#include "core/html/track/vtt/VTTToken.h" #include "core/html/track/vtt/VTTToken.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class VTTTokenizer { class VTTTokenizer {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(VTTTokenizer); WTF_MAKE_NONCOPYABLE(VTTTokenizer);
public: public:
explicit VTTTokenizer(const String& input); explicit VTTTokenizer(const String& input);
......
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