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

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

Issue 2732643003: DevTools: remove PerformanceMonitor::HandlerCall, migrate to the new scoped probes. (Closed)
Patch Set: Introduce progress monitor Created 3 years, 9 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/InspectorInstrumentation.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
index 047948087fd0da966275d2905ff87d85a956e29c..a646c324e9127c9edb351b30b1d6c859b4b2cf35 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
@@ -52,6 +52,23 @@ namespace blink {
namespace probe {
+double ProbeBase::captureStartTime() const {
+ if (!m_startTime)
+ m_startTime = monotonicallyIncreasingTime();
+ return m_startTime;
+}
+
+double ProbeBase::captureEndTime() const {
+ if (!m_endTime)
+ m_endTime = monotonicallyIncreasingTime();
+ return m_endTime;
+}
+
+double ProbeBase::duration() const {
+ DCHECK(m_startTime);
+ return captureEndTime() - m_startTime;
+}
+
AsyncTask::AsyncTask(ExecutionContext* context, void* task)
: AsyncTask(context, task, true) {}

Powered by Google App Engine
This is Rietveld 408576698