| Index: Source/core/inspector/InspectorTimelineAgent.cpp
|
| diff --git a/Source/core/inspector/InspectorTimelineAgent.cpp b/Source/core/inspector/InspectorTimelineAgent.cpp
|
| index c30db88f7f3835224baeeb206736f8dd04841038..aaa5addb29244d3b7ce838633caea4784f91dadd 100644
|
| --- a/Source/core/inspector/InspectorTimelineAgent.cpp
|
| +++ b/Source/core/inspector/InspectorTimelineAgent.cpp
|
| @@ -46,6 +46,7 @@
|
| #include "core/inspector/InspectorOverlay.h"
|
| #include "core/inspector/InspectorPageAgent.h"
|
| #include "core/inspector/InspectorState.h"
|
| +#include "core/inspector/InspectorTracingAgent.h"
|
| #include "core/inspector/InstrumentingAgents.h"
|
| #include "core/inspector/ScriptCallStack.h"
|
| #include "core/inspector/TimelineRecordFactory.h"
|
| @@ -73,7 +74,6 @@ static const char includeCounters[] = "includeCounters";
|
| static const char includeGPUEvents[] = "includeGPUEvents";
|
| static const char bufferEvents[] = "bufferEvents";
|
| static const char liveEvents[] = "liveEvents";
|
| -static const char traceEventCategoryFilter[] = "traceEventCategoryFilter";
|
| }
|
|
|
| // Must be kept in sync with WebInspector.TimelineModel.RecordType in TimelineModel.js
|
| @@ -300,10 +300,9 @@ void InspectorTimelineAgent::restore()
|
| }
|
| }
|
|
|
| -void InspectorTimelineAgent::enable(ErrorString*, const String* traceEventCategoryFilter)
|
| +void InspectorTimelineAgent::enable(ErrorString*)
|
| {
|
| m_state->setBoolean(TimelineAgentState::enabled, true);
|
| - m_state->setString(TimelineAgentState::traceEventCategoryFilter, traceEventCategoryFilter ? *traceEventCategoryFilter : "");
|
| }
|
|
|
| void InspectorTimelineAgent::disable(ErrorString*)
|
| @@ -357,13 +356,6 @@ void InspectorTimelineAgent::innerStart()
|
| if (m_overlay)
|
| m_overlay->startedRecordingProfile();
|
| m_state->setBoolean(TimelineAgentState::started, true);
|
| - String traceEventCategoryFilter = m_state->getString(TimelineAgentState::traceEventCategoryFilter);
|
| - if (!traceEventCategoryFilter.isEmpty()) {
|
| - m_client->enableTracing(traceEventCategoryFilter);
|
| - m_disableTracingOnStop = true;
|
| - } else {
|
| - m_disableTracingOnStop = false;
|
| - }
|
| m_instrumentingAgents->setInspectorTimelineAgent(this);
|
| ScriptGCEvent::addEventListener(this);
|
| if (m_client) {
|
| @@ -418,11 +410,6 @@ void InspectorTimelineAgent::innerStop(bool fromConsole)
|
| if (m_state->getBoolean(TimelineAgentState::includeGPUEvents))
|
| m_client->stopGPUEventsRecording();
|
| }
|
| - // If we have enabled tracing, disable it now.
|
| - if (m_disableTracingOnStop) {
|
| - m_client->disableTracing();
|
| - m_disableTracingOnStop = false;
|
| - }
|
| m_instrumentingAgents->setInspectorTimelineAgent(0);
|
| ScriptGCEvent::removeEventListener(this);
|
|
|
| @@ -831,6 +818,8 @@ void InspectorTimelineAgent::consoleTimeline(ExecutionContext* context, const St
|
| m_consoleTimelines.append(title);
|
| if (!isStarted()) {
|
| innerStart();
|
| + if (m_tracingAgent)
|
| + m_tracingAgent->startFromBackend();
|
| bool fromConsole = true;
|
| m_frontend->started(&fromConsole);
|
| }
|
| @@ -854,6 +843,8 @@ void InspectorTimelineAgent::consoleTimelineEnd(ExecutionContext* context, const
|
| m_consoleTimelines.remove(index);
|
| if (!m_consoleTimelines.size() && isStarted() && !m_state->getBoolean(TimelineAgentState::startedFromProtocol)) {
|
| unwindRecordStack();
|
| + if (m_tracingAgent)
|
| + m_tracingAgent->endFromBackend();
|
| innerStop(true);
|
| }
|
| mainFrame()->console().addMessage(ConsoleAPIMessageSource, DebugMessageLevel, message, String(), 0, 0, nullptr, scriptState);
|
| @@ -1195,12 +1186,13 @@ void InspectorTimelineAgent::unwindRecordStack()
|
| }
|
| }
|
|
|
| -InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, InspectorDOMAgent* domAgent, InspectorLayerTreeAgent* layerTreeAgent,
|
| +InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, InspectorDOMAgent* domAgent, InspectorLayerTreeAgent* layerTreeAgent, InspectorTracingAgent* tracingAgent,
|
| InspectorOverlay* overlay, InspectorType type, InspectorClient* client)
|
| : InspectorBaseAgent<InspectorTimelineAgent>("Timeline")
|
| , m_pageAgent(pageAgent)
|
| , m_domAgent(domAgent)
|
| , m_layerTreeAgent(layerTreeAgent)
|
| + , m_tracingAgent(tracingAgent)
|
| , m_frontend(0)
|
| , m_client(client)
|
| , m_overlay(overlay)
|
| @@ -1214,7 +1206,6 @@ InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, In
|
| , m_styleRecalcElementCounter(0)
|
| , m_mayEmitFirstPaint(false)
|
| , m_lastProgressTimestamp(0)
|
| - , m_disableTracingOnStop(false)
|
| {
|
| }
|
|
|
|
|