Chromium Code Reviews| Index: third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.cpp |
| diff --git a/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.cpp |
| index 6f99692e698373030d5c0de4453b72f971312f91..e2da5e402dd1fd11e7a59445e50ae3628471e238 100644 |
| --- a/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.cpp |
| +++ b/third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.cpp |
| @@ -4,18 +4,33 @@ |
| #include "core/inspector/InspectorWebPerfAgent.h" |
| +#include "core/InstrumentingAgents.h" |
| #include "core/frame/LocalFrame.h" |
| #include "core/inspector/InspectedFrames.h" |
| +#include "public/platform/Platform.h" |
| namespace blink { |
| +// Register InspectorAgent to begin observing LongTaskTiming |
| +void InspectorWebPerfAgent::enableInstrumentation(LocalFrame* frame) |
| +{ |
| + if (frame->isLocalRoot()) { |
|
alph
2016/08/22 22:21:27
style: use early return
|
| + InspectorWebPerfAgent* agent = new InspectorWebPerfAgent( |
| + InspectedFrames::create(frame)); |
| + frame->instrumentingAgents()->addInspectorWebPerfAgent( |
|
alph
2016/08/22 22:21:27
nit: make it a single line.
|
| + agent); |
| + } |
| +} |
| + |
| InspectorWebPerfAgent::InspectorWebPerfAgent(InspectedFrames* inspectedFrames) |
| : m_inspectedFrames(inspectedFrames) |
| { |
| + Platform::current()->currentThread()->addTaskTimeObserver(this); |
| } |
| InspectorWebPerfAgent::~InspectorWebPerfAgent() |
| { |
| + Platform::current()->currentThread()->removeTaskTimeObserver(this); |
| } |
| void InspectorWebPerfAgent::willExecuteScript(ExecutionContext* context) |
| @@ -26,6 +41,18 @@ void InspectorWebPerfAgent::didExecuteScript() |
| { |
| } |
| +void InspectorWebPerfAgent::willProcessTask() |
| +{ |
| +} |
| + |
| +void InspectorWebPerfAgent::didProcessTask() |
| +{ |
| +} |
| + |
| +void InspectorWebPerfAgent::reportTaskTime(double startTime, double endTime) |
| +{ |
| +} |
| + |
| DEFINE_TRACE(InspectorWebPerfAgent) |
| { |
| visitor->trace(m_inspectedFrames); |