Commit 95824c42 authored by tasak@google.com's avatar tasak@google.com

Make classes and structures in core/inspector 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/1308273007

git-svn-id: svn://svn.chromium.org/blink/trunk@201632 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e647a2a4
......@@ -55,6 +55,7 @@ class XMLHttpRequest;
class CORE_EXPORT AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<AsyncCallTracker>, public V8DebuggerAgent::AsyncCallTrackingListener {
WTF_MAKE_NONCOPYABLE(AsyncCallTracker);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(AsyncCallTracker);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(AsyncCallTracker);
public:
AsyncCallTracker(V8DebuggerAgent*, InstrumentingAgents*);
~AsyncCallTracker() override;
......
......@@ -27,6 +27,7 @@
#define IdentifiersFactory_h
#include "core/CoreExport.h"
#include "wtf/Allocator.h"
#include "wtf/text/WTFString.h"
namespace blink {
......@@ -35,6 +36,7 @@ class DocumentLoader;
class LocalFrame;
class CORE_EXPORT IdentifiersFactory {
STATIC_ONLY(IdentifiersFactory);
public:
static void setProcessId(long);
static String createIdentifier();
......
......@@ -35,6 +35,7 @@
#include "core/InspectorTypeBuilder.h"
#include "core/inspector/InjectedScriptManager.h"
#include "core/inspector/InjectedScriptNative.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h"
#include <v8.h>
......@@ -49,6 +50,7 @@ PassRefPtr<JSONValue> toJSONValue(const ScriptValue&);
class InjectedScript final {
DISALLOW_ALLOCATION();
public:
InjectedScript();
~InjectedScript();
......
......@@ -5,9 +5,12 @@
#ifndef InjectedScriptHostClient_h
#define InjectedScriptHostClient_h
#include "wtf/FastAllocBase.h"
namespace blink {
class InjectedScriptHostClient {
WTF_MAKE_FAST_ALLOCATED(InjectedScriptHostClient);
public:
virtual void muteWarningsAndDeprecations() { }
virtual void unmuteWarningsAndDeprecations() { }
......
......@@ -48,6 +48,7 @@ class InstrumentingAgents;
class LocalFrame;
class CORE_EXPORT InspectorAgent : public NoBaseWillBeGarbageCollectedFinalized<InspectorAgent> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InspectorAgent);
public:
explicit InspectorAgent(const String&);
virtual ~InspectorAgent();
......
......@@ -77,6 +77,7 @@ public:
};
class InlineStyleOverrideScope {
STACK_ALLOCATED();
public:
InlineStyleOverrideScope(SecurityContext* context)
: m_contentSecurityPolicy(context->contentSecurityPolicy())
......
......@@ -81,6 +81,7 @@ private:
namespace InspectorInstrumentation {
class CORE_EXPORT FrontendCounter {
STATIC_ONLY(FrontendCounter);
private:
friend void frontendCreated();
friend void frontendDeleted();
......
......@@ -92,6 +92,7 @@ private:
class CORE_EXPORT InspectorCompositeState final : public NoBaseWillBeGarbageCollectedFinalized<InspectorCompositeState>, public InspectorStateUpdateListener {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(InspectorCompositeState);
WTF_MAKE_NONCOPYABLE(InspectorCompositeState);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(InspectorCompositeState);
public:
InspectorCompositeState(InspectorStateClient* inspectorStateClient)
: m_client(inspectorStateClient)
......
......@@ -6,6 +6,8 @@
#define InspectorTaskRunner_h
#include "core/CoreExport.h"
#include "wtf/Allocator.h"
#include "wtf/FastAllocBase.h"
#include "wtf/Forward.h"
#include "wtf/Noncopyable.h"
#include "wtf/OwnPtr.h"
......@@ -16,11 +18,13 @@ namespace blink {
class CORE_EXPORT InspectorTaskRunner final {
WTF_MAKE_NONCOPYABLE(InspectorTaskRunner);
WTF_MAKE_FAST_ALLOCATED(InspectorTaskRunner);
public:
explicit InspectorTaskRunner(v8::Isolate*);
~InspectorTaskRunner();
class Task {
WTF_MAKE_FAST_ALLOCATED(Task);
public:
virtual ~Task() { }
virtual void run() = 0;
......@@ -31,6 +35,7 @@ public:
void runPendingTasks();
class CORE_EXPORT IgnoreInterruptsScope final {
WTF_MAKE_FAST_ALLOCATED(IgnoreInterruptsScope);
public:
explicit IgnoreInterruptsScope(InspectorTaskRunner*);
~IgnoreInterruptsScope();
......
......@@ -45,12 +45,14 @@ class WorkerThread;
class XMLHttpRequest;
class InspectorLayoutEvent {
STATIC_ONLY(InspectorLayoutEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> beginData(FrameView*);
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> endData(LayoutObject* rootForThisLayout);
};
class InspectorScheduleStyleInvalidationTrackingEvent {
STATIC_ONLY(InspectorScheduleStyleInvalidationTrackingEvent);
public:
static const char Attribute[];
static const char Class[];
......@@ -75,6 +77,7 @@ private:
InspectorScheduleStyleInvalidationTrackingEvent::changeType((element), (invalidationSet), __VA_ARGS__))
class InspectorStyleRecalcInvalidationTrackingEvent {
STATIC_ONLY(InspectorStyleRecalcInvalidationTrackingEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(Node*, const StyleChangeReasonForTracing&);
};
......@@ -82,6 +85,7 @@ public:
String descendantInvalidationSetToIdString(const DescendantInvalidationSet&);
class InspectorStyleInvalidatorInvalidateEvent {
STATIC_ONLY(InspectorStyleInvalidatorInvalidateEvent);
public:
static const char ElementHasPendingInvalidationList[];
static const char InvalidateCustomPseudo[];
......@@ -159,82 +163,98 @@ extern const char ScrollbarChanged[];
typedef const char LayoutInvalidationReasonForTracing[];
class CORE_EXPORT InspectorLayoutInvalidationTrackingEvent {
STATIC_ONLY(InspectorLayoutInvalidationTrackingEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const LayoutObject*, LayoutInvalidationReasonForTracing);
};
class InspectorPaintInvalidationTrackingEvent {
STATIC_ONLY(InspectorPaintInvalidationTrackingEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const LayoutObject*, const LayoutObject& paintContainer);
};
class InspectorScrollInvalidationTrackingEvent {
STATIC_ONLY(InspectorScrollInvalidationTrackingEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const LayoutObject&);
};
class InspectorSendRequestEvent {
STATIC_ONLY(InspectorSendRequestEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(unsigned long identifier, LocalFrame*, const ResourceRequest&);
};
class InspectorReceiveResponseEvent {
STATIC_ONLY(InspectorReceiveResponseEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(unsigned long identifier, LocalFrame*, const ResourceResponse&);
};
class InspectorReceiveDataEvent {
STATIC_ONLY(InspectorReceiveDataEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(unsigned long identifier, LocalFrame*, int encodedDataLength);
};
class InspectorResourceFinishEvent {
STATIC_ONLY(InspectorResourceFinishEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(unsigned long identifier, double finishTime, bool didFail);
};
class InspectorTimerInstallEvent {
STATIC_ONLY(InspectorTimerInstallEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int timerId, int timeout, bool singleShot);
};
class InspectorTimerRemoveEvent {
STATIC_ONLY(InspectorTimerRemoveEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int timerId);
};
class InspectorTimerFireEvent {
STATIC_ONLY(InspectorTimerFireEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int timerId);
};
class InspectorAnimationFrameEvent {
STATIC_ONLY(InspectorAnimationFrameEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int callbackId);
};
class InspectorParseHtmlEvent {
STATIC_ONLY(InspectorParseHtmlEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> beginData(Document*, unsigned startLine);
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> endData(unsigned endLine);
};
class InspectorParseAuthorStyleSheetEvent {
STATIC_ONLY(InspectorParseAuthorStyleSheetEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const CSSStyleSheetResource*);
};
class InspectorXhrReadyStateChangeEvent {
STATIC_ONLY(InspectorXhrReadyStateChangeEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, XMLHttpRequest*);
};
class InspectorXhrLoadEvent {
STATIC_ONLY(InspectorXhrLoadEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, XMLHttpRequest*);
};
class InspectorLayerInvalidationTrackingEvent {
STATIC_ONLY(InspectorLayerInvalidationTrackingEvent);
public:
static const char SquashingLayerGeometryWasUpdated[];
static const char AddedToSquashingLayer[];
......@@ -253,11 +273,13 @@ public:
InspectorLayerInvalidationTrackingEvent::data((LAYER), (REASON)))
class InspectorPaintEvent {
STATIC_ONLY(InspectorPaintEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LayoutObject*, const LayoutRect& clipRect, const GraphicsLayer*);
};
class InspectorPaintImageEvent {
STATIC_ONLY(InspectorPaintImageEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const LayoutImage&);
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const LayoutObject&, const StyleImage&);
......@@ -265,86 +287,103 @@ public:
};
class InspectorCommitLoadEvent {
STATIC_ONLY(InspectorCommitLoadEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LocalFrame*);
};
class InspectorMarkLoadEvent {
STATIC_ONLY(InspectorMarkLoadEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LocalFrame*);
};
class InspectorScrollLayerEvent {
STATIC_ONLY(InspectorScrollLayerEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LayoutObject*);
};
class InspectorUpdateLayerTreeEvent {
STATIC_ONLY(InspectorUpdateLayerTreeEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LocalFrame*);
};
class InspectorEvaluateScriptEvent {
STATIC_ONLY(InspectorEvaluateScriptEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LocalFrame*, const String& url, int lineNumber);
};
class InspectorFunctionCallEvent {
STATIC_ONLY(InspectorFunctionCallEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, int scriptId, const String& scriptName, int scriptLine);
};
class InspectorUpdateCountersEvent {
STATIC_ONLY(InspectorUpdateCountersEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data();
};
class InspectorInvalidateLayoutEvent {
STATIC_ONLY(InspectorInvalidateLayoutEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LocalFrame*);
};
class InspectorRecalculateStylesEvent {
STATIC_ONLY(InspectorRecalculateStylesEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(LocalFrame*);
};
class InspectorEventDispatchEvent {
STATIC_ONLY(InspectorEventDispatchEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const Event&);
};
class InspectorTimeStampEvent {
STATIC_ONLY(InspectorTimeStampEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(ExecutionContext*, const String& message);
};
class InspectorTracingSessionIdForWorkerEvent {
STATIC_ONLY(InspectorTracingSessionIdForWorkerEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const String& sessionId, const String& workerId, WorkerThread*);
};
class InspectorTracingStartedInFrame {
STATIC_ONLY(InspectorTracingStartedInFrame);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const String& sessionId, LocalFrame*);
};
class InspectorSetLayerTreeId {
STATIC_ONLY(InspectorSetLayerTreeId);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const String& sessionId, int layerTreeId);
};
class InspectorAnimationEvent {
STATIC_ONLY(InspectorAnimationEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const Animation&);
};
class InspectorAnimationStateEvent {
STATIC_ONLY(InspectorAnimationStateEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> data(const Animation&);
};
class InspectorHitTestEvent {
STATIC_ONLY(InspectorHitTestEvent);
public:
static PassRefPtr<TraceEvent::ConvertableToTraceFormat> endData(const HitTestRequest&, const HitTestLocation&, const HitTestResult&);
};
......
......@@ -32,7 +32,7 @@
#define InstanceCounters_h
#include "core/CoreExport.h"
#include "wtf/FastAllocBase.h"
#include "wtf/Allocator.h"
#if ENABLE(ASSERT)
#include "wtf/MainThread.h"
......@@ -41,6 +41,7 @@
namespace blink {
class InstanceCounters {
STATIC_ONLY(InstanceCounters);
public:
enum CounterType {
ActiveDOMObjectCounter,
......@@ -73,8 +74,6 @@ public:
CORE_EXPORT static int counterValue(CounterType);
private:
InstanceCounters();
CORE_EXPORT static int s_counters[CounterTypeLength];
};
......
......@@ -23,6 +23,7 @@ class JSONArray;
class JSONObject;
class CORE_EXPORT LayoutEditor final : public NoBaseWillBeGarbageCollectedFinalized<LayoutEditor> {
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(LayoutEditor);
public:
static PassOwnPtrWillBeRawPtr<LayoutEditor> create(InspectorCSSAgent* cssAgent, InspectorDOMAgent* domAgent)
{
......
......@@ -49,6 +49,7 @@ class CORE_EXPORT MainThreadDebugger final : public ScriptDebuggerBase {
WTF_MAKE_NONCOPYABLE(MainThreadDebugger);
public:
class ClientMessageLoop {
WTF_MAKE_FAST_ALLOCATED(ClientMessageLoop);
public:
virtual ~ClientMessageLoop() { }
virtual void run(LocalFrame*) = 0;
......
......@@ -23,6 +23,7 @@ class ScriptValue;
class PromiseTracker final : public NoBaseWillBeGarbageCollectedFinalized<PromiseTracker> {
WTF_MAKE_NONCOPYABLE(PromiseTracker);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(PromiseTracker);
public:
class CORE_EXPORT Listener : public WillBeGarbageCollectedMixin {
public:
......
......@@ -5,6 +5,7 @@
#ifndef RemoteObjectId_h
#define RemoteObjectId_h
#include "wtf/FastAllocBase.h"
#include "wtf/Forward.h"
namespace blink {
......@@ -12,6 +13,7 @@ namespace blink {
class JSONObject;
class RemoteObjectIdBase {
WTF_MAKE_FAST_ALLOCATED(RemoteObjectIdBase);
public:
int contextId() const { return m_injectedScriptId; }
......
......@@ -32,6 +32,7 @@
#define ScriptCallFrame_h
#include "core/InspectorTypeBuilder.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h"
#include "wtf/text/WTFString.h"
......@@ -40,6 +41,7 @@ namespace blink {
class TracedValue;
class ScriptCallFrame {
ALLOW_ONLY_INLINE_ALLOCATION();
public:
ScriptCallFrame();
ScriptCallFrame(const String& functionName, const String& scriptId, const String& scriptName, unsigned lineNumber, unsigned column = 0);
......
......@@ -19,6 +19,7 @@ class ScriptState;
class V8AsyncCallTracker final : public NoBaseWillBeGarbageCollectedFinalized<V8AsyncCallTracker>, public ScriptState::Observer, public V8DebuggerAgent::AsyncCallTrackingListener {
WTF_MAKE_NONCOPYABLE(V8AsyncCallTracker);
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(V8AsyncCallTracker);
WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(V8AsyncCallTracker);
public:
static PassOwnPtrWillBeRawPtr<V8AsyncCallTracker> create(V8DebuggerAgent* debuggerAgent)
{
......
......@@ -30,11 +30,13 @@
#ifndef ScriptBreakpoint_h
#define ScriptBreakpoint_h
#include "wtf/Allocator.h"
#include "wtf/text/WTFString.h"
namespace blink {
struct ScriptBreakpoint {
STACK_ALLOCATED();
ScriptBreakpoint() : ScriptBreakpoint(0, 0, String()) { }
ScriptBreakpoint(int lineNumber, int columnNumber, const String& condition)
......
......@@ -8,6 +8,7 @@
#include "core/CoreExport.h"
#include "core/InspectorTypeBuilder.h"
#include "core/inspector/v8/V8DebuggerListener.h"
#include "wtf/FastAllocBase.h"
#include "wtf/Forward.h"
#include "wtf/PassOwnPtr.h"
......@@ -21,6 +22,7 @@ class V8DebuggerClient;
struct ScriptBreakpoint;
class CORE_EXPORT V8Debugger {
WTF_MAKE_FAST_ALLOCATED(V8Debugger);
public:
static PassOwnPtr<V8Debugger> create(v8::Isolate*, V8DebuggerClient*);
virtual ~V8Debugger() { }
......
......@@ -6,6 +6,7 @@
#define V8DebuggerClient_h
#include "core/CoreExport.h"
#include "wtf/FastAllocBase.h"
#include <v8.h>
......@@ -14,6 +15,7 @@ namespace blink {
class V8DebuggerListener;
class CORE_EXPORT V8DebuggerClient {
WTF_MAKE_FAST_ALLOCATED(V8DebuggerClient);
public:
virtual ~V8DebuggerClient() { }
virtual v8::Local<v8::Object> compileDebuggerScript() = 0;
......
......@@ -31,6 +31,7 @@
#define V8DebuggerListener_h
#include "core/CoreExport.h"
#include "wtf/Allocator.h"
#include "wtf/Forward.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
......@@ -43,6 +44,7 @@ enum CompileResult { CompileSuccess, CompileError };
class CORE_EXPORT V8DebuggerListener {
public:
class Script {
DISALLOW_ALLOCATION();
public:
Script();
......@@ -97,6 +99,7 @@ public:
};
struct ParsedScript {
ALLOW_ONLY_INLINE_ALLOCATION();
String scriptId;
Script script;
CompileResult compileResult;
......
......@@ -5,6 +5,7 @@
#ifndef V8JavaScriptCallFrame_h
#define V8JavaScriptCallFrame_h
#include "wtf/Allocator.h"
#include "wtf/Forward.h"
#include <v8.h>
......@@ -13,6 +14,7 @@ namespace blink {
class JavaScriptCallFrame;
class V8JavaScriptCallFrame {
STATIC_ONLY(V8JavaScriptCallFrame);
public:
static v8::Local<v8::FunctionTemplate> createWrapperTemplate(v8::Isolate*);
static v8::Local<v8::Object> wrap(v8::Local<v8::FunctionTemplate> constructorTemplate, v8::Local<v8::Context>, PassRefPtr<JavaScriptCallFrame>);
......
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