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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorWebPerfAgent.cpp

Issue 2259013003: Move and rename TaskTimeTracker to public interface exposed to WebThread, use in WebPerf Agent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch TaskTimeTracker over to WebThread::TaskTimeObserver Created 4 years, 4 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
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);

Powered by Google App Engine
This is Rietveld 408576698