InstrumentingAgents.cpp [plain text]
#include "config.h"
#include "InstrumentingAgents.h"
#if ENABLE(INSPECTOR)
#include "InspectorController.h"
#include "Page.h"
#include "WorkerGlobalScope.h"
#include "WorkerInspectorController.h"
#include <wtf/MainThread.h>
using namespace Inspector;
namespace WebCore {
InstrumentingAgents::InstrumentingAgents(InspectorEnvironment& environment)
: m_environment(environment)
, m_inspectorAgent(nullptr)
, m_inspectorPageAgent(nullptr)
, m_inspectorCSSAgent(nullptr)
, m_inspectorLayerTreeAgent(nullptr)
, m_webConsoleAgent(nullptr)
, m_inspectorDOMAgent(nullptr)
, m_inspectorResourceAgent(nullptr)
, m_pageRuntimeAgent(nullptr)
, m_workerRuntimeAgent(nullptr)
, m_inspectorTimelineAgent(nullptr)
, m_persistentInspectorTimelineAgent(nullptr)
, m_inspectorDOMStorageAgent(nullptr)
#if ENABLE(WEB_REPLAY)
, m_inspectorReplayAgent(nullptr)
#endif
#if ENABLE(SQL_DATABASE)
, m_inspectorDatabaseAgent(nullptr)
#endif
, m_inspectorApplicationCacheAgent(nullptr)
, m_inspectorDebuggerAgent(nullptr)
, m_pageDebuggerAgent(nullptr)
, m_inspectorDOMDebuggerAgent(nullptr)
, m_inspectorProfilerAgent(nullptr)
, m_inspectorWorkerAgent(nullptr)
{
}
void InstrumentingAgents::reset()
{
m_inspectorAgent = nullptr;
m_inspectorPageAgent = nullptr;
m_inspectorCSSAgent = nullptr;
m_inspectorLayerTreeAgent = nullptr;
m_webConsoleAgent = nullptr;
m_inspectorDOMAgent = nullptr;
m_inspectorResourceAgent = nullptr;
m_pageRuntimeAgent = nullptr;
m_workerRuntimeAgent = nullptr;
m_inspectorTimelineAgent = nullptr;
m_persistentInspectorTimelineAgent = nullptr;
m_inspectorDOMStorageAgent = nullptr;
#if ENABLE(WEB_REPLAY)
m_inspectorReplayAgent = nullptr;
#endif
#if ENABLE(SQL_DATABASE)
m_inspectorDatabaseAgent = nullptr;
#endif
m_inspectorApplicationCacheAgent = nullptr;
m_inspectorDebuggerAgent = nullptr;
m_pageDebuggerAgent = nullptr;
m_inspectorDOMDebuggerAgent = nullptr;
m_inspectorProfilerAgent = nullptr;
m_inspectorWorkerAgent = nullptr;
}
InstrumentingAgents* instrumentationForPage(Page* page)
{
ASSERT(isMainThread());
return page ? page->inspectorController().m_instrumentingAgents.get() : nullptr;
}
InstrumentingAgents* instrumentationForWorkerGlobalScope(WorkerGlobalScope* workerGlobalScope)
{
return workerGlobalScope ? workerGlobalScope->workerInspectorController().m_instrumentingAgents.get() : nullptr;
}
}
#endif // ENABLE(INSPECTOR)