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

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

Issue 693483004: Enable Oilpan for core/timing/. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: de-weakify Performance::m_memoryInfo Created 5 years, 8 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') | no next file » | 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 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
« no previous file with comments | « Source/modules/performance/WorkerPerformance.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698