diff options
Diffstat (limited to 'Source/WebCore/inspector/InstrumentingAgents.h')
-rw-r--r-- | Source/WebCore/inspector/InstrumentingAgents.h | 120 |
1 files changed, 57 insertions, 63 deletions
diff --git a/Source/WebCore/inspector/InstrumentingAgents.h b/Source/WebCore/inspector/InstrumentingAgents.h index d9b5d41dc..64e8138a1 100644 --- a/Source/WebCore/inspector/InstrumentingAgents.h +++ b/Source/WebCore/inspector/InstrumentingAgents.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2011 Google Inc. All rights reserved. + * Copyright (C) 2014, 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -28,13 +29,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef InstrumentingAgents_h -#define InstrumentingAgents_h +#pragma once #include <inspector/InspectorEnvironment.h> #include <wtf/FastMalloc.h> #include <wtf/Noncopyable.h> -#include <wtf/PassRefPtr.h> #include <wtf/RefCounted.h> namespace Inspector { @@ -46,32 +45,32 @@ namespace WebCore { class InspectorApplicationCacheAgent; class InspectorCSSAgent; -class InspectorCanvasAgent; -class InspectorConsoleAgent; class InspectorDOMAgent; class InspectorDOMDebuggerAgent; class InspectorDOMStorageAgent; class InspectorDatabaseAgent; -class InspectorHeapProfilerAgent; class InspectorLayerTreeAgent; +class InspectorWorkerAgent; +class InspectorMemoryAgent; +class InspectorNetworkAgent; class InspectorPageAgent; -class InspectorProfilerAgent; -class InspectorResourceAgent; +class InspectorReplayAgent; class InspectorTimelineAgent; -class InspectorWorkerAgent; class Page; class PageDebuggerAgent; +class PageHeapAgent; class PageRuntimeAgent; -class WorkerGlobalScope; -class WorkerRuntimeAgent; +class WebConsoleAgent; class InstrumentingAgents : public RefCounted<InstrumentingAgents> { WTF_MAKE_NONCOPYABLE(InstrumentingAgents); WTF_MAKE_FAST_ALLOCATED; public: - static PassRefPtr<InstrumentingAgents> create(Inspector::InspectorEnvironment& environment) + // FIXME: InstrumentingAgents could be uniquely owned by InspectorController if instrumentation + // cookies kept only a weak reference to InstrumentingAgents. Then, reset() would be unnecessary. + static Ref<InstrumentingAgents> create(Inspector::InspectorEnvironment& environment) { - return adoptRef(new InstrumentingAgents(environment)); + return adoptRef(*new InstrumentingAgents(environment)); } ~InstrumentingAgents() { } void reset(); @@ -87,31 +86,39 @@ public: InspectorCSSAgent* inspectorCSSAgent() const { return m_inspectorCSSAgent; } void setInspectorCSSAgent(InspectorCSSAgent* agent) { m_inspectorCSSAgent = agent; } - InspectorConsoleAgent* inspectorConsoleAgent() const { return m_inspectorConsoleAgent; } - void setInspectorConsoleAgent(InspectorConsoleAgent* agent) { m_inspectorConsoleAgent = agent; } + WebConsoleAgent* webConsoleAgent() const { return m_webConsoleAgent; } + void setWebConsoleAgent(WebConsoleAgent* agent) { m_webConsoleAgent = agent; } InspectorDOMAgent* inspectorDOMAgent() const { return m_inspectorDOMAgent; } void setInspectorDOMAgent(InspectorDOMAgent* agent) { m_inspectorDOMAgent = agent; } - InspectorResourceAgent* inspectorResourceAgent() const { return m_inspectorResourceAgent; } - void setInspectorResourceAgent(InspectorResourceAgent* agent) { m_inspectorResourceAgent = agent; } + InspectorNetworkAgent* inspectorNetworkAgent() const { return m_inspectorNetworkAgent; } + void setInspectorNetworkAgent(InspectorNetworkAgent* agent) { m_inspectorNetworkAgent = agent; } PageRuntimeAgent* pageRuntimeAgent() const { return m_pageRuntimeAgent; } void setPageRuntimeAgent(PageRuntimeAgent* agent) { m_pageRuntimeAgent = agent; } - WorkerRuntimeAgent* workerRuntimeAgent() const { return m_workerRuntimeAgent; } - void setWorkerRuntimeAgent(WorkerRuntimeAgent* agent) { m_workerRuntimeAgent = agent; } - InspectorTimelineAgent* inspectorTimelineAgent() const { return m_inspectorTimelineAgent; } void setInspectorTimelineAgent(InspectorTimelineAgent* agent) { m_inspectorTimelineAgent = agent; } + InspectorTimelineAgent* persistentInspectorTimelineAgent() const { return m_persistentInspectorTimelineAgent; } + void setPersistentInspectorTimelineAgent(InspectorTimelineAgent* agent) { m_persistentInspectorTimelineAgent = agent; } + InspectorDOMStorageAgent* inspectorDOMStorageAgent() const { return m_inspectorDOMStorageAgent; } void setInspectorDOMStorageAgent(InspectorDOMStorageAgent* agent) { m_inspectorDOMStorageAgent = agent; } -#if ENABLE(SQL_DATABASE) +#if ENABLE(WEB_REPLAY) + InspectorReplayAgent* inspectorReplayAgent() const { return m_inspectorReplayAgent; } + void setInspectorReplayAgent(InspectorReplayAgent* agent) { m_inspectorReplayAgent = agent; } +#endif + +#if ENABLE(RESOURCE_USAGE) + InspectorMemoryAgent* inspectorMemoryAgent() const { return m_inspectorMemoryAgent; } + void setInspectorMemoryAgent(InspectorMemoryAgent* agent) { m_inspectorMemoryAgent = agent; } +#endif + InspectorDatabaseAgent* inspectorDatabaseAgent() const { return m_inspectorDatabaseAgent; } void setInspectorDatabaseAgent(InspectorDatabaseAgent* agent) { m_inspectorDatabaseAgent = agent; } -#endif InspectorApplicationCacheAgent* inspectorApplicationCacheAgent() const { return m_inspectorApplicationCacheAgent; } void setInspectorApplicationCacheAgent(InspectorApplicationCacheAgent* agent) { m_inspectorApplicationCacheAgent = agent; } @@ -122,60 +129,47 @@ public: PageDebuggerAgent* pageDebuggerAgent() const { return m_pageDebuggerAgent; } void setPageDebuggerAgent(PageDebuggerAgent* agent) { m_pageDebuggerAgent = agent; } + PageHeapAgent* pageHeapAgent() const { return m_pageHeapAgent; } + void setPageHeapAgent(PageHeapAgent* agent) { m_pageHeapAgent = agent; } + InspectorDOMDebuggerAgent* inspectorDOMDebuggerAgent() const { return m_inspectorDOMDebuggerAgent; } void setInspectorDOMDebuggerAgent(InspectorDOMDebuggerAgent* agent) { m_inspectorDOMDebuggerAgent = agent; } - InspectorProfilerAgent* inspectorProfilerAgent() const { return m_inspectorProfilerAgent; } - void setInspectorProfilerAgent(InspectorProfilerAgent* agent) { m_inspectorProfilerAgent = agent; } - - InspectorHeapProfilerAgent* inspectorHeapProfilerAgent() const { return m_inspectorHeapProfilerAgent; } - void setInspectorHeapProfilerAgent(InspectorHeapProfilerAgent* agent) { m_inspectorHeapProfilerAgent = agent; } + InspectorLayerTreeAgent* inspectorLayerTreeAgent() const { return m_inspectorLayerTreeAgent; } + void setInspectorLayerTreeAgent(InspectorLayerTreeAgent* agent) { m_inspectorLayerTreeAgent = agent; } InspectorWorkerAgent* inspectorWorkerAgent() const { return m_inspectorWorkerAgent; } void setInspectorWorkerAgent(InspectorWorkerAgent* agent) { m_inspectorWorkerAgent = agent; } - InspectorCanvasAgent* inspectorCanvasAgent() const { return m_inspectorCanvasAgent; } - void setInspectorCanvasAgent(InspectorCanvasAgent* agent) { m_inspectorCanvasAgent = agent; } - -#if USE(ACCELERATED_COMPOSITING) - InspectorLayerTreeAgent* inspectorLayerTreeAgent() const { return m_inspectorLayerTreeAgent; } - void setInspectorLayerTreeAgent(InspectorLayerTreeAgent* agent) { m_inspectorLayerTreeAgent = agent; } -#endif - private: InstrumentingAgents(Inspector::InspectorEnvironment&); Inspector::InspectorEnvironment& m_environment; - Inspector::InspectorAgent* m_inspectorAgent; - InspectorPageAgent* m_inspectorPageAgent; - InspectorCSSAgent* m_inspectorCSSAgent; -#if USE(ACCELERATED_COMPOSITING) - InspectorLayerTreeAgent* m_inspectorLayerTreeAgent; + Inspector::InspectorAgent* m_inspectorAgent { nullptr }; + InspectorPageAgent* m_inspectorPageAgent { nullptr }; + InspectorCSSAgent* m_inspectorCSSAgent { nullptr }; + InspectorLayerTreeAgent* m_inspectorLayerTreeAgent { nullptr }; + InspectorWorkerAgent* m_inspectorWorkerAgent { nullptr }; + WebConsoleAgent* m_webConsoleAgent { nullptr }; + InspectorDOMAgent* m_inspectorDOMAgent { nullptr }; + InspectorNetworkAgent* m_inspectorNetworkAgent { nullptr }; + PageRuntimeAgent* m_pageRuntimeAgent { nullptr }; + InspectorTimelineAgent* m_inspectorTimelineAgent { nullptr }; + InspectorTimelineAgent* m_persistentInspectorTimelineAgent { nullptr }; + InspectorDOMStorageAgent* m_inspectorDOMStorageAgent { nullptr }; +#if ENABLE(WEB_REPLAY) + InspectorReplayAgent* m_inspectorReplayAgent { nullptr }; #endif - InspectorConsoleAgent* m_inspectorConsoleAgent; - InspectorDOMAgent* m_inspectorDOMAgent; - InspectorResourceAgent* m_inspectorResourceAgent; - PageRuntimeAgent* m_pageRuntimeAgent; - WorkerRuntimeAgent* m_workerRuntimeAgent; - InspectorTimelineAgent* m_inspectorTimelineAgent; - InspectorDOMStorageAgent* m_inspectorDOMStorageAgent; -#if ENABLE(SQL_DATABASE) - InspectorDatabaseAgent* m_inspectorDatabaseAgent; +#if ENABLE(RESOURCE_USAGE) + InspectorMemoryAgent* m_inspectorMemoryAgent { nullptr }; #endif - InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent; - Inspector::InspectorDebuggerAgent* m_inspectorDebuggerAgent; - PageDebuggerAgent* m_pageDebuggerAgent; - InspectorDOMDebuggerAgent* m_inspectorDOMDebuggerAgent; - InspectorProfilerAgent* m_inspectorProfilerAgent; - InspectorHeapProfilerAgent* m_inspectorHeapProfilerAgent; - InspectorWorkerAgent* m_inspectorWorkerAgent; - InspectorCanvasAgent* m_inspectorCanvasAgent; + InspectorDatabaseAgent* m_inspectorDatabaseAgent { nullptr }; + InspectorApplicationCacheAgent* m_inspectorApplicationCacheAgent { nullptr }; + Inspector::InspectorDebuggerAgent* m_inspectorDebuggerAgent { nullptr }; + PageDebuggerAgent* m_pageDebuggerAgent { nullptr }; + PageHeapAgent* m_pageHeapAgent { nullptr }; + InspectorDOMDebuggerAgent* m_inspectorDOMDebuggerAgent { nullptr }; }; -InstrumentingAgents* instrumentationForPage(Page*); -InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope*); - -} - -#endif // !defined(InstrumentingAgents_h) +} // namespace WebCore |