| Index: Source/core/inspector/InspectorTimelineAgent.cpp
|
| diff --git a/Source/core/inspector/InspectorTimelineAgent.cpp b/Source/core/inspector/InspectorTimelineAgent.cpp
|
| index 09db80d4f67f51487045cae4e615be43d1a3ce72..506bc1afe4db6271025efe7f184ac40b93b2d3b9 100644
|
| --- a/Source/core/inspector/InspectorTimelineAgent.cpp
|
| +++ b/Source/core/inspector/InspectorTimelineAgent.cpp
|
| @@ -369,6 +369,16 @@ void InspectorTimelineAgent::willPaint(RenderObject* renderer)
|
| pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Paint, true, frame, true);
|
| }
|
|
|
| +void InspectorTimelineAgent::willUpdateLayer(int)
|
| +{
|
| + enablePlatformInstrumentation();
|
| +}
|
| +
|
| +void InspectorTimelineAgent::didUpdateLayer()
|
| +{
|
| + disablePlatformInstrumentation();
|
| +}
|
| +
|
| void InspectorTimelineAgent::didPaint(RenderObject* renderer, GraphicsContext*, const LayoutRect& clipRect)
|
| {
|
| TimelineRecordEntry& entry = m_recordStack.last();
|
| @@ -409,6 +419,16 @@ void InspectorTimelineAgent::didResizeImage()
|
| didCompleteCurrentRecord(TimelineRecordType::ResizeImage);
|
| }
|
|
|
| +void InspectorTimelineAgent::willRasterizeCanvas()
|
| +{
|
| + pushCurrentRecord(InspectorObject::create(), TimelineRecordType::Rasterize, false, 0);
|
| +}
|
| +
|
| +void InspectorTimelineAgent::didRasterizeCanvas()
|
| +{
|
| + didCompleteCurrentRecord(TimelineRecordType::Rasterize);
|
| +}
|
| +
|
| void InspectorTimelineAgent::willComposite()
|
| {
|
| pushCurrentRecord(InspectorObject::create(), TimelineRecordType::CompositeLayers, false, 0);
|
| @@ -712,10 +732,7 @@ void InspectorTimelineAgent::didCompleteCurrentRecord(const String& type)
|
| // An empty stack could merely mean that the timeline agent was turned on in the middle of
|
| // an event. Don't treat as an error.
|
| if (!m_recordStack.isEmpty()) {
|
| - if (m_platformInstrumentationClientInstalledAtStackDepth == m_recordStack.size()) {
|
| - m_platformInstrumentationClientInstalledAtStackDepth = 0;
|
| - PlatformInstrumentation::setClient(0);
|
| - }
|
| + disablePlatformInstrumentation();
|
|
|
| pushGCEventRecords();
|
| TimelineRecordEntry entry = m_recordStack.last();
|
| @@ -770,9 +787,23 @@ void InspectorTimelineAgent::pushCurrentRecord(PassRefPtr<InspectorObject> data,
|
| RefPtr<InspectorObject> record = TimelineRecordFactory::createGenericRecord(timestamp(), captureCallStack ? m_maxCallStackDepth : 0, type);
|
| setFrameIdentifier(record.get(), frame);
|
| m_recordStack.append(TimelineRecordEntry(record.release(), data, InspectorArray::create(), type, getUsedHeapSize()));
|
| - if (hasLowLevelDetails && !m_platformInstrumentationClientInstalledAtStackDepth && !PlatformInstrumentation::hasClient()) {
|
| - m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.size();
|
| - PlatformInstrumentation::setClient(this);
|
| + if (hasLowLevelDetails)
|
| + enablePlatformInstrumentation();
|
| +}
|
| +
|
| +void InspectorTimelineAgent::enablePlatformInstrumentation()
|
| +{
|
| + if (m_platformInstrumentationClientInstalledAtStackDepth || PlatformInstrumentation::hasClient())
|
| + return;
|
| + m_platformInstrumentationClientInstalledAtStackDepth = m_recordStack.size();
|
| + PlatformInstrumentation::setClient(this);
|
| +}
|
| +
|
| +void InspectorTimelineAgent::disablePlatformInstrumentation()
|
| +{
|
| + if (m_platformInstrumentationClientInstalledAtStackDepth == m_recordStack.size()) {
|
| + m_platformInstrumentationClientInstalledAtStackDepth = 0;
|
| + PlatformInstrumentation::setClient(0);
|
| }
|
| }
|
|
|
|
|