| Index: third_party/WebKit/Source/core/timing/Performance.cpp
|
| diff --git a/third_party/WebKit/Source/core/timing/Performance.cpp b/third_party/WebKit/Source/core/timing/Performance.cpp
|
| index 8b236f6a17d02988229c54ca22ea9e3099acbee9..e584ca6bb4ac0fa2b7bc2125a41536d0d3461c48 100644
|
| --- a/third_party/WebKit/Source/core/timing/Performance.cpp
|
| +++ b/third_party/WebKit/Source/core/timing/Performance.cpp
|
| @@ -33,6 +33,8 @@
|
|
|
| #include "core/dom/Document.h"
|
| #include "core/frame/LocalFrame.h"
|
| +#include "core/inspector/InspectedFrames.h"
|
| +#include "core/inspector/InspectorWebPerfAgent.h"
|
| #include "core/loader/DocumentLoader.h"
|
| #include "core/timing/PerformanceTiming.h"
|
|
|
| @@ -92,10 +94,23 @@ PerformanceTiming* Performance::timing() const
|
| return m_timing.get();
|
| }
|
|
|
| +void Performance::updateLongTaskInstrumentation()
|
| +{
|
| + if (hasObserverFor(PerformanceEntry::LongTask) && !m_longTaskInspectorAgent) {
|
| + m_longTaskInspectorAgent = new InspectorWebPerfAgent(
|
| + InspectedFrames::create(frame()));
|
| + m_longTaskInspectorAgent->enable();
|
| + } else if (!hasObserverFor(PerformanceEntry::LongTask) && m_longTaskInspectorAgent) {
|
| + m_longTaskInspectorAgent->disable();
|
| + m_longTaskInspectorAgent = nullptr;
|
| + }
|
| +}
|
| +
|
| DEFINE_TRACE(Performance)
|
| {
|
| visitor->trace(m_navigation);
|
| visitor->trace(m_timing);
|
| + visitor->trace(m_longTaskInspectorAgent);
|
| DOMWindowProperty::trace(visitor);
|
| PerformanceBase::trace(visitor);
|
| }
|
|
|