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