Index: Source/modules/performance/WorkerPerformance.cpp |
diff --git a/Source/modules/performance/WorkerPerformance.cpp b/Source/modules/performance/WorkerPerformance.cpp |
index b62e5f6f3b2ba8b0efe71e00323edfbc9f2a1fa8..d3e0c3da7b514a88abcc4ea77636ac0861911f99 100644 |
--- a/Source/modules/performance/WorkerPerformance.cpp |
+++ b/Source/modules/performance/WorkerPerformance.cpp |
@@ -42,6 +42,11 @@ WorkerPerformance::WorkerPerformance() |
{ |
} |
+DEFINE_TRACE(WorkerPerformance) |
+{ |
+ visitor->trace(m_memoryInfo); |
+} |
+ |
double WorkerPerformance::now(ExecutionContext* context) const |
{ |
ASSERT(context); |
@@ -50,10 +55,12 @@ double WorkerPerformance::now(ExecutionContext* context) const |
return 1000.0 * (monotonicallyIncreasingTime() - workerGlobalScope->timeOrigin()); |
} |
-PassRefPtrWillBeRawPtr<MemoryInfo> WorkerPerformance::memory() const |
+MemoryInfo* WorkerPerformance::memory() |
{ |
- // FIXME: We shall not create a new object every time. |
- return MemoryInfo::create(); |
+ if (!m_memoryInfo) |
+ m_memoryInfo = MemoryInfo::create(); |
+ |
+ return m_memoryInfo.get(); |
} |
} // namespace blink |