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

Unified Diff: Source/modules/performance/WorkerPerformance.cpp

Issue 1100813004: Offer User Timing in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 6 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
« no previous file with comments | « Source/modules/performance/WorkerPerformance.h ('k') | Source/modules/performance/WorkerPerformance.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/performance/WorkerPerformance.cpp
diff --git a/Source/modules/performance/WorkerPerformance.cpp b/Source/modules/performance/WorkerPerformance.cpp
index d3e0c3da7b514a88abcc4ea77636ac0861911f99..5fd9b15228f91884fb59f9d5280dcb0a4c9fb438 100644
--- a/Source/modules/performance/WorkerPerformance.cpp
+++ b/Source/modules/performance/WorkerPerformance.cpp
@@ -38,21 +38,22 @@
namespace blink {
-WorkerPerformance::WorkerPerformance()
+WorkerPerformance::WorkerPerformance(WorkerGlobalScope* context)
+ : PerformanceBase(context->timeOrigin())
+ , ContextLifecycleObserver(context)
{
}
-DEFINE_TRACE(WorkerPerformance)
+ExecutionContext* WorkerPerformance::executionContext() const
{
- visitor->trace(m_memoryInfo);
+ return ContextLifecycleObserver::executionContext();
}
-double WorkerPerformance::now(ExecutionContext* context) const
+DEFINE_TRACE(WorkerPerformance)
{
- ASSERT(context);
- ASSERT(context->isWorkerGlobalScope());
- WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
- return 1000.0 * (monotonicallyIncreasingTime() - workerGlobalScope->timeOrigin());
+ visitor->trace(m_memoryInfo);
+ PerformanceBase::trace(visitor);
+ ContextLifecycleObserver::trace(visitor);
}
MemoryInfo* WorkerPerformance::memory()
« no previous file with comments | « Source/modules/performance/WorkerPerformance.h ('k') | Source/modules/performance/WorkerPerformance.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698