| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 339 |
| 340 bool InspectorTimelineAgent::isStarted() | 340 bool InspectorTimelineAgent::isStarted() |
| 341 { | 341 { |
| 342 return m_state->getBoolean(TimelineAgentState::started); | 342 return m_state->getBoolean(TimelineAgentState::started); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void InspectorTimelineAgent::innerStart() | 345 void InspectorTimelineAgent::innerStart() |
| 346 { | 346 { |
| 347 if (m_overlay) | 347 if (m_overlay) |
| 348 m_overlay->startedRecordingProfile(); | 348 m_overlay->startedRecordingProfile(); |
| 349 m_registry->profilerStarted(); | |
| 350 m_state->setBoolean(TimelineAgentState::started, true); | 349 m_state->setBoolean(TimelineAgentState::started, true); |
| 351 m_instrumentingAgents->setInspectorTimelineAgent(this); | 350 m_instrumentingAgents->setInspectorTimelineAgent(this); |
| 352 ScriptGCEvent::addEventListener(this); | 351 ScriptGCEvent::addEventListener(this); |
| 353 if (m_client) { | 352 if (m_client) { |
| 354 TraceEventDispatcher* dispatcher = TraceEventDispatcher::instance(); | 353 TraceEventDispatcher* dispatcher = TraceEventDispatcher::instance(); |
| 355 dispatcher->addListener(InstrumentationEvents::BeginFrame, TRACE_EVENT_P
HASE_INSTANT, this, &InspectorTimelineAgent::onBeginImplSideFrame, m_client); | 354 dispatcher->addListener(InstrumentationEvents::BeginFrame, TRACE_EVENT_P
HASE_INSTANT, this, &InspectorTimelineAgent::onBeginImplSideFrame, m_client); |
| 356 dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_P
HASE_BEGIN, this, &InspectorTimelineAgent::onPaintSetupBegin, m_client); | 355 dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_P
HASE_BEGIN, this, &InspectorTimelineAgent::onPaintSetupBegin, m_client); |
| 357 dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_P
HASE_END, this, &InspectorTimelineAgent::onPaintSetupEnd, m_client); | 356 dispatcher->addListener(InstrumentationEvents::PaintSetup, TRACE_EVENT_P
HASE_END, this, &InspectorTimelineAgent::onPaintSetupEnd, m_client); |
| 358 dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_P
HASE_BEGIN, this, &InspectorTimelineAgent::onRasterTaskBegin, m_client); | 357 dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_P
HASE_BEGIN, this, &InspectorTimelineAgent::onRasterTaskBegin, m_client); |
| 359 dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_P
HASE_END, this, &InspectorTimelineAgent::onRasterTaskEnd, m_client); | 358 dispatcher->addListener(InstrumentationEvents::RasterTask, TRACE_EVENT_P
HASE_END, this, &InspectorTimelineAgent::onRasterTaskEnd, m_client); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 void InspectorTimelineAgent::innerStop(bool fromConsole) | 395 void InspectorTimelineAgent::innerStop(bool fromConsole) |
| 397 { | 396 { |
| 398 m_state->setBoolean(TimelineAgentState::started, false); | 397 m_state->setBoolean(TimelineAgentState::started, false); |
| 399 | 398 |
| 400 if (m_client) { | 399 if (m_client) { |
| 401 TraceEventDispatcher::instance()->removeAllListeners(this, m_client); | 400 TraceEventDispatcher::instance()->removeAllListeners(this, m_client); |
| 402 if (m_state->getBoolean(TimelineAgentState::includeGPUEvents)) | 401 if (m_state->getBoolean(TimelineAgentState::includeGPUEvents)) |
| 403 m_client->stopGPUEventsRecording(); | 402 m_client->stopGPUEventsRecording(); |
| 404 } | 403 } |
| 405 m_instrumentingAgents->setInspectorTimelineAgent(0); | 404 m_instrumentingAgents->setInspectorTimelineAgent(0); |
| 406 m_registry->profilerStopped(); | |
| 407 ScriptGCEvent::removeEventListener(this); | 405 ScriptGCEvent::removeEventListener(this); |
| 408 | 406 |
| 409 clearRecordStack(); | 407 clearRecordStack(); |
| 410 m_threadStates.clear(); | 408 m_threadStates.clear(); |
| 411 m_gpuTask.clear(); | 409 m_gpuTask.clear(); |
| 412 m_layerToNodeMap.clear(); | 410 m_layerToNodeMap.clear(); |
| 413 m_pixelRefToImageInfo.clear(); | 411 m_pixelRefToImageInfo.clear(); |
| 414 m_imageBeingPainted = 0; | 412 m_imageBeingPainted = 0; |
| 415 m_paintSetupStart = 0; | 413 m_paintSetupStart = 0; |
| 416 m_mayEmitFirstPaint = false; | 414 m_mayEmitFirstPaint = false; |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1142 | 1140 |
| 1143 void InspectorTimelineAgent::unwindRecordStack() | 1141 void InspectorTimelineAgent::unwindRecordStack() |
| 1144 { | 1142 { |
| 1145 while (!m_recordStack.isEmpty()) { | 1143 while (!m_recordStack.isEmpty()) { |
| 1146 TimelineRecordEntry& entry = m_recordStack.last(); | 1144 TimelineRecordEntry& entry = m_recordStack.last(); |
| 1147 didCompleteCurrentRecord(entry.type); | 1145 didCompleteCurrentRecord(entry.type); |
| 1148 } | 1146 } |
| 1149 } | 1147 } |
| 1150 | 1148 |
| 1151 InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, In
spectorLayerTreeAgent* layerTreeAgent, | 1149 InspectorTimelineAgent::InspectorTimelineAgent(InspectorPageAgent* pageAgent, In
spectorLayerTreeAgent* layerTreeAgent, |
| 1152 InspectorOverlay* overlay, InspectorType type, InspectorClient* client, Insp
ectorAgentRegistry* registry) | 1150 InspectorOverlay* overlay, InspectorType type, InspectorClient* client) |
| 1153 : InspectorBaseAgent<InspectorTimelineAgent>("Timeline") | 1151 : InspectorBaseAgent<InspectorTimelineAgent>("Timeline") |
| 1154 , m_pageAgent(pageAgent) | 1152 , m_pageAgent(pageAgent) |
| 1155 , m_layerTreeAgent(layerTreeAgent) | 1153 , m_layerTreeAgent(layerTreeAgent) |
| 1156 , m_frontend(0) | 1154 , m_frontend(0) |
| 1157 , m_client(client) | 1155 , m_client(client) |
| 1158 , m_overlay(overlay) | 1156 , m_overlay(overlay) |
| 1159 , m_inspectorType(type) | 1157 , m_inspectorType(type) |
| 1160 , m_id(1) | 1158 , m_id(1) |
| 1161 , m_layerTreeId(0) | 1159 , m_layerTreeId(0) |
| 1162 , m_maxCallStackDepth(5) | 1160 , m_maxCallStackDepth(5) |
| 1163 , m_platformInstrumentationClientInstalledAtStackDepth(0) | 1161 , m_platformInstrumentationClientInstalledAtStackDepth(0) |
| 1164 , m_imageBeingPainted(0) | 1162 , m_imageBeingPainted(0) |
| 1165 , m_paintSetupStart(0) | 1163 , m_paintSetupStart(0) |
| 1166 , m_mayEmitFirstPaint(false) | 1164 , m_mayEmitFirstPaint(false) |
| 1167 , m_lastProgressTimestamp(0) | 1165 , m_lastProgressTimestamp(0) |
| 1168 , m_registry(registry) | |
| 1169 { | 1166 { |
| 1170 } | 1167 } |
| 1171 | 1168 |
| 1172 void InspectorTimelineAgent::appendRecord(PassRefPtr<JSONObject> data, const Str
ing& type, bool captureCallStack, LocalFrame* frame) | 1169 void InspectorTimelineAgent::appendRecord(PassRefPtr<JSONObject> data, const Str
ing& type, bool captureCallStack, LocalFrame* frame) |
| 1173 { | 1170 { |
| 1174 double ts = timestamp(); | 1171 double ts = timestamp(); |
| 1175 RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(ts
, captureCallStack ? m_maxCallStackDepth : 0, type, data); | 1172 RefPtr<TimelineEvent> record = TimelineRecordFactory::createGenericRecord(ts
, captureCallStack ? m_maxCallStackDepth : 0, type, data); |
| 1176 setFrameIdentifier(record.get(), frame); | 1173 setFrameIdentifier(record.get(), frame); |
| 1177 addRecordToTimeline(record.release(), ts); | 1174 addRecordToTimeline(record.release(), ts); |
| 1178 } | 1175 } |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 | 1305 |
| 1309 #ifndef NDEBUG | 1306 #ifndef NDEBUG |
| 1310 bool TimelineRecordStack::isOpenRecordOfType(const String& type) | 1307 bool TimelineRecordStack::isOpenRecordOfType(const String& type) |
| 1311 { | 1308 { |
| 1312 return !m_stack.isEmpty() && m_stack.last().type == type; | 1309 return !m_stack.isEmpty() && m_stack.last().type == type; |
| 1313 } | 1310 } |
| 1314 #endif | 1311 #endif |
| 1315 | 1312 |
| 1316 } // namespace WebCore | 1313 } // namespace WebCore |
| 1317 | 1314 |
| OLD | NEW |