Commit e4c842a4 authored by tasak@google.com's avatar tasak@google.com

Make classes and structures in core/frame 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/1315783003

git-svn-id: svn://svn.chromium.org/blink/trunk@201205 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 6c0ffe6c
...@@ -6,10 +6,12 @@ ...@@ -6,10 +6,12 @@
#define DeprecatedScheduleStyleRecalcDuringLayout_h #define DeprecatedScheduleStyleRecalcDuringLayout_h
#include "core/dom/DocumentLifecycle.h" #include "core/dom/DocumentLifecycle.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
class DeprecatedScheduleStyleRecalcDuringLayout { class DeprecatedScheduleStyleRecalcDuringLayout {
STACK_ALLOCATED();
WTF_MAKE_NONCOPYABLE(DeprecatedScheduleStyleRecalcDuringLayout); WTF_MAKE_NONCOPYABLE(DeprecatedScheduleStyleRecalcDuringLayout);
public: public:
explicit DeprecatedScheduleStyleRecalcDuringLayout(DocumentLifecycle&); explicit DeprecatedScheduleStyleRecalcDuringLayout(DocumentLifecycle&);
......
...@@ -16,6 +16,7 @@ class Document; ...@@ -16,6 +16,7 @@ class Document;
class Event; class Event;
class CORE_EXPORT DeviceSingleWindowEventController : public NoBaseWillBeGarbageCollectedFinalized<DeviceSingleWindowEventController>, public PlatformEventController, public DOMWindowLifecycleObserver { class CORE_EXPORT DeviceSingleWindowEventController : public NoBaseWillBeGarbageCollectedFinalized<DeviceSingleWindowEventController>, public PlatformEventController, public DOMWindowLifecycleObserver {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DeviceSingleWindowEventController);
public: public:
virtual ~DeviceSingleWindowEventController(); virtual ~DeviceSingleWindowEventController();
......
...@@ -20,6 +20,7 @@ typedef HashCountedSet<EventTarget*> EventTargetSet; ...@@ -20,6 +20,7 @@ typedef HashCountedSet<EventTarget*> EventTargetSet;
// documents that can be rendered or can receive input (i.e., are attached to a // documents that can be rendered or can receive input (i.e., are attached to a
// FrameHost) are registered here. // FrameHost) are registered here.
class CORE_EXPORT EventHandlerRegistry final : public NoBaseWillBeGarbageCollectedFinalized<EventHandlerRegistry> { class CORE_EXPORT EventHandlerRegistry final : public NoBaseWillBeGarbageCollectedFinalized<EventHandlerRegistry> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(EventHandlerRegistry);
public: public:
explicit EventHandlerRegistry(FrameHost&); explicit EventHandlerRegistry(FrameHost&);
virtual ~EventHandlerRegistry(); virtual ~EventHandlerRegistry();
......
...@@ -17,6 +17,7 @@ class SecurityOrigin; ...@@ -17,6 +17,7 @@ class SecurityOrigin;
enum class FrameDetachType; enum class FrameDetachType;
class CORE_EXPORT FrameClient : public NoBaseWillBeGarbageCollectedFinalized<FrameClient> { class CORE_EXPORT FrameClient : public NoBaseWillBeGarbageCollectedFinalized<FrameClient> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(FrameClient);
public: public:
virtual bool inShadowTree() const = 0; virtual bool inShadowTree() const = 0;
......
...@@ -49,6 +49,7 @@ class WorkerGlobalScopeProxy; ...@@ -49,6 +49,7 @@ class WorkerGlobalScopeProxy;
// FrameConsole takes per-frame console messages and routes them up through the FrameHost to the ChromeClient and Inspector. // FrameConsole takes per-frame console messages and routes them up through the FrameHost to the ChromeClient and Inspector.
// It's meant as an abstraction around ChromeClient calls and the way that Blink core/ can add messages to the console. // It's meant as an abstraction around ChromeClient calls and the way that Blink core/ can add messages to the console.
class CORE_EXPORT FrameConsole final : public NoBaseWillBeGarbageCollected<FrameConsole> { class CORE_EXPORT FrameConsole final : public NoBaseWillBeGarbageCollected<FrameConsole> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(FrameConsole);
DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(FrameConsole); DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(FrameConsole);
public: public:
static PassOwnPtrWillBeRawPtr<FrameConsole> create(LocalFrame& frame) static PassOwnPtrWillBeRawPtr<FrameConsole> create(LocalFrame& frame)
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include "platform/scroll/Scrollbar.h" #include "platform/scroll/Scrollbar.h"
#include "public/platform/WebDisplayMode.h" #include "public/platform/WebDisplayMode.h"
#include "public/platform/WebRect.h" #include "public/platform/WebRect.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h" #include "wtf/Forward.h"
#include "wtf/HashSet.h" #include "wtf/HashSet.h"
#include "wtf/ListHashSet.h" #include "wtf/ListHashSet.h"
...@@ -585,6 +586,7 @@ protected: ...@@ -585,6 +586,7 @@ protected:
void updateScrollbars(const DoubleSize& desiredOffset); void updateScrollbars(const DoubleSize& desiredOffset);
class InUpdateScrollbarsScope { class InUpdateScrollbarsScope {
STACK_ALLOCATED();
public: public:
explicit InUpdateScrollbarsScope(FrameView* view) explicit InUpdateScrollbarsScope(FrameView* view)
: m_scope(view->m_inUpdateScrollbars, true) : m_scope(view->m_inUpdateScrollbars, true)
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef LayoutSubtreeRootList_h #ifndef LayoutSubtreeRootList_h
#define LayoutSubtreeRootList_h #define LayoutSubtreeRootList_h
#include "wtf/Allocator.h"
#include "wtf/HashSet.h" #include "wtf/HashSet.h"
#include "wtf/Vector.h" #include "wtf/Vector.h"
...@@ -27,6 +28,7 @@ class LayoutObject; ...@@ -27,6 +28,7 @@ class LayoutObject;
// TODO(leviw): This should really be something akin to a LayoutController // TODO(leviw): This should really be something akin to a LayoutController
// that FrameView delegates layout work to. // that FrameView delegates layout work to.
class LayoutSubtreeRootList { class LayoutSubtreeRootList {
DISALLOW_ALLOCATION();
public: public:
LayoutSubtreeRootList() LayoutSubtreeRootList()
{ } { }
......
...@@ -44,6 +44,7 @@ public: ...@@ -44,6 +44,7 @@ public:
void updateMeasurementsAndClear(); void updateMeasurementsAndClear();
class CORE_EXPORT Value { class CORE_EXPORT Value {
ALLOW_ONLY_INLINE_ALLOCATION();
public: public:
Value(); Value();
......
...@@ -33,10 +33,12 @@ ...@@ -33,10 +33,12 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/geometry/FloatSize.h" #include "platform/geometry/FloatSize.h"
#include "wtf/Allocator.h"
namespace blink { namespace blink {
struct CORE_EXPORT PageScaleConstraints { struct CORE_EXPORT PageScaleConstraints {
DISALLOW_ALLOCATION();
FloatSize layoutSize; FloatSize layoutSize;
float initialScale; float initialScale;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "core/frame/PageScaleConstraints.h" #include "core/frame/PageScaleConstraints.h"
#include "platform/Length.h" #include "platform/Length.h"
#include "platform/geometry/IntSize.h" #include "platform/geometry/IntSize.h"
#include "wtf/FastAllocBase.h"
#include "wtf/PassOwnPtr.h" #include "wtf/PassOwnPtr.h"
namespace blink { namespace blink {
...@@ -43,6 +44,7 @@ namespace blink { ...@@ -43,6 +44,7 @@ namespace blink {
// This class harmonizes the viewport (particularly page scale) constraints from // This class harmonizes the viewport (particularly page scale) constraints from
// the meta viewport tag and other sources. // the meta viewport tag and other sources.
class CORE_EXPORT PageScaleConstraintsSet { class CORE_EXPORT PageScaleConstraintsSet {
WTF_MAKE_FAST_ALLOCATED(PageScaleConstraintsSet);
public: public:
static PassOwnPtr<PageScaleConstraintsSet> create() static PassOwnPtr<PageScaleConstraintsSet> create()
{ {
......
...@@ -22,6 +22,7 @@ class LayoutRect; ...@@ -22,6 +22,7 @@ class LayoutRect;
// the layout viewport. Thus, we could say this class is a decorator on the // the layout viewport. Thus, we could say this class is a decorator on the
// FrameView scrollable area that adds pinch-zoom semantics to scrolling. // FrameView scrollable area that adds pinch-zoom semantics to scrolling.
class CORE_EXPORT RootFrameViewport final : public NoBaseWillBeGarbageCollectedFinalized<RootFrameViewport>, public ScrollableArea { class CORE_EXPORT RootFrameViewport final : public NoBaseWillBeGarbageCollectedFinalized<RootFrameViewport>, public ScrollableArea {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(RootFrameViewport);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RootFrameViewport); WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(RootFrameViewport);
public: public:
static PassOwnPtrWillBeRawPtr<RootFrameViewport> create(ScrollableArea& visualViewport, ScrollableArea& layoutViewport, bool invertScrollOrder = false) static PassOwnPtrWillBeRawPtr<RootFrameViewport> create(ScrollableArea& visualViewport, ScrollableArea& layoutViewport, bool invertScrollOrder = false)
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "platform/Crypto.h" #include "platform/Crypto.h"
#include "wtf/Allocator.h"
namespace WTF { namespace WTF {
class String; class String;
...@@ -20,6 +21,7 @@ class KURL; ...@@ -20,6 +21,7 @@ class KURL;
class Resource; class Resource;
class CORE_EXPORT SubresourceIntegrity { class CORE_EXPORT SubresourceIntegrity {
STATIC_ONLY(SubresourceIntegrity);
public: public:
enum IntegrityParseResult { enum IntegrityParseResult {
IntegrityParseValidResult, IntegrityParseValidResult,
......
...@@ -20,6 +20,7 @@ class FloatSize; ...@@ -20,6 +20,7 @@ class FloatSize;
// to completion is still handled by compositor and kicks in when scrolling is // to completion is still handled by compositor and kicks in when scrolling is
// complete (i.e, upon ScrollEnd or FlingEnd). // complete (i.e, upon ScrollEnd or FlingEnd).
class CORE_EXPORT TopControls final : public NoBaseWillBeGarbageCollectedFinalized<TopControls> { class CORE_EXPORT TopControls final : public NoBaseWillBeGarbageCollectedFinalized<TopControls> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(TopControls);
public: public:
static PassOwnPtrWillBeRawPtr<TopControls> create(const FrameHost& host) static PassOwnPtrWillBeRawPtr<TopControls> create(const FrameHost& host)
{ {
......
...@@ -56,6 +56,7 @@ class StyleSheetContents; ...@@ -56,6 +56,7 @@ class StyleSheetContents;
// http://www.google.com/chrome/intl/en/privacy.html // http://www.google.com/chrome/intl/en/privacy.html
class CORE_EXPORT UseCounter { class CORE_EXPORT UseCounter {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(UseCounter); WTF_MAKE_NONCOPYABLE(UseCounter);
public: public:
UseCounter(); UseCounter();
...@@ -890,6 +891,7 @@ public: ...@@ -890,6 +891,7 @@ public:
static void unmuteForInspector(); static void unmuteForInspector();
class CountBits { class CountBits {
DISALLOW_ALLOCATION();
public: public:
CountBits() : m_bits(NumberOfFeatures) { } CountBits() : m_bits(NumberOfFeatures) { }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "core/CoreExport.h" #include "core/CoreExport.h"
#include "core/frame/csp/ContentSecurityPolicy.h" #include "core/frame/csp/ContentSecurityPolicy.h"
#include "wtf/FastAllocBase.h"
#include "wtf/text/WTFString.h" #include "wtf/text/WTFString.h"
namespace blink { namespace blink {
...@@ -15,6 +16,7 @@ class ContentSecurityPolicy; ...@@ -15,6 +16,7 @@ class ContentSecurityPolicy;
class KURL; class KURL;
class CORE_EXPORT CSPSource { class CORE_EXPORT CSPSource {
WTF_MAKE_FAST_ALLOCATED(CSPSource);
public: public:
enum WildcardDisposition { enum WildcardDisposition {
HasWildcard, HasWildcard,
......
...@@ -18,6 +18,7 @@ class ContentSecurityPolicy; ...@@ -18,6 +18,7 @@ class ContentSecurityPolicy;
class KURL; class KURL;
class CORE_EXPORT CSPSourceList { class CORE_EXPORT CSPSourceList {
DISALLOW_ALLOCATION();
WTF_MAKE_NONCOPYABLE(CSPSourceList); WTF_MAKE_NONCOPYABLE(CSPSourceList);
public: public:
CSPSourceList(ContentSecurityPolicy*, const String& directiveName); CSPSourceList(ContentSecurityPolicy*, const String& directiveName);
......
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