Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1249)

Unified Diff: Source/core/inspector/TimelineTraceEventProcessor.cpp

Issue 18344005: DevTools: expose setLayerTreeId() so we can relate events from LayerTreeHost (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed another regression Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/TimelineTraceEventProcessor.h ('k') | Source/web/WebDevToolsAgentImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/TimelineTraceEventProcessor.cpp
diff --git a/Source/core/inspector/TimelineTraceEventProcessor.cpp b/Source/core/inspector/TimelineTraceEventProcessor.cpp
index a2323e097981c6a61020adc7f4535729dd65ce71..ba28720c02408e6a1d8ce69ab83719860e2e0be3 100644
--- a/Source/core/inspector/TimelineTraceEventProcessor.cpp
+++ b/Source/core/inspector/TimelineTraceEventProcessor.cpp
@@ -152,15 +152,18 @@ TimelineTraceEventProcessor::TimelineTraceEventProcessor(WeakPtr<InspectorTimeli
, m_timeConverter(timelineAgent.get()->timeConverter())
, m_inspectorClient(client)
, m_pageId(reinterpret_cast<unsigned long long>(m_timelineAgent.get()->page()))
+ , m_layerTreeId(m_timelineAgent.get()->layerTreeId())
, m_layerId(0)
, m_paintSetupStart(0)
, m_paintSetupEnd(0)
{
registerHandler(InstrumentationEvents::BeginFrame, TracePhaseInstant, &TimelineTraceEventProcessor::onBeginFrame);
- registerHandler(InstrumentationEvents::PaintSetup, TracePhaseBegin, &TimelineTraceEventProcessor::onPaintSetupBegin);
- registerHandler(InstrumentationEvents::PaintSetup, TracePhaseEnd, &TimelineTraceEventProcessor::onPaintSetupEnd);
+ registerHandler(InstrumentationEvents::UpdateLayer, TracePhaseBegin, &TimelineTraceEventProcessor::onUpdateLayerBegin);
+ registerHandler(InstrumentationEvents::UpdateLayer, TracePhaseEnd, &TimelineTraceEventProcessor::onUpdateLayerEnd);
registerHandler(InstrumentationEvents::PaintLayer, TracePhaseBegin, &TimelineTraceEventProcessor::onPaintLayerBegin);
registerHandler(InstrumentationEvents::PaintLayer, TracePhaseEnd, &TimelineTraceEventProcessor::onPaintLayerEnd);
+ registerHandler(InstrumentationEvents::PaintSetup, TracePhaseBegin, &TimelineTraceEventProcessor::onPaintSetupBegin);
+ registerHandler(InstrumentationEvents::PaintSetup, TracePhaseEnd, &TimelineTraceEventProcessor::onPaintSetupEnd);
registerHandler(InstrumentationEvents::RasterTask, TracePhaseBegin, &TimelineTraceEventProcessor::onRasterTaskBegin);
registerHandler(InstrumentationEvents::RasterTask, TracePhaseEnd, &TimelineTraceEventProcessor::onRasterTaskEnd);
registerHandler(InstrumentationEvents::ImageDecodeTask, TracePhaseBegin, &TimelineTraceEventProcessor::onImageDecodeTaskBegin);
@@ -230,27 +233,46 @@ void TimelineTraceEventProcessor::onBeginFrame(const TraceEvent&)
processBackgroundEvents();
}
-void TimelineTraceEventProcessor::onPaintSetupBegin(const TraceEvent& event)
+void TimelineTraceEventProcessor::onUpdateLayerBegin(const TraceEvent& event)
{
- ASSERT(!m_paintSetupStart);
- m_paintSetupStart = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+ unsigned long long layerTreeId = event.asUInt(InstrumentationEventArguments::LayerTreeId);
+ if (layerTreeId != m_layerTreeId)
+ return;
+ m_layerId = event.asUInt(InstrumentationEventArguments::LayerId);
+ // We don't know the node yet. For content layers, the node will be updated
+ // by paint. For others, let it remain 0 -- we just need the fact that
+ // the layer belongs to the page (see cookie check).
+ m_layerToNodeMap.add(m_layerId, 0);
}
-void TimelineTraceEventProcessor::onPaintSetupEnd(const TraceEvent& event)
+void TimelineTraceEventProcessor::onUpdateLayerEnd(const TraceEvent& event)
{
- ASSERT(m_paintSetupStart);
- m_paintSetupEnd = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+ m_layerId = 0;
}
void TimelineTraceEventProcessor::onPaintLayerBegin(const TraceEvent& event)
{
m_layerId = event.asUInt(InstrumentationEventArguments::LayerId);
ASSERT(m_layerId);
+ ASSERT(!m_paintSetupStart);
}
-void TimelineTraceEventProcessor::onPaintLayerEnd(const TraceEvent&)
+void TimelineTraceEventProcessor::onPaintLayerEnd(const TraceEvent& event)
{
m_layerId = 0;
+ ASSERT(m_paintSetupStart);
+}
+
+void TimelineTraceEventProcessor::onPaintSetupBegin(const TraceEvent& event)
+{
+ ASSERT(!m_paintSetupStart);
+ m_paintSetupStart = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
+}
+
+void TimelineTraceEventProcessor::onPaintSetupEnd(const TraceEvent& event)
+{
+ ASSERT(m_paintSetupStart);
+ m_paintSetupEnd = m_timeConverter.fromMonotonicallyIncreasingTime(event.timestamp());
}
void TimelineTraceEventProcessor::onRasterTaskBegin(const TraceEvent& event)
« no previous file with comments | « Source/core/inspector/TimelineTraceEventProcessor.h ('k') | Source/web/WebDevToolsAgentImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698