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() |