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

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

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 7 years 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: Source/modules/performance/WorkerPerformance.cpp
diff --git a/Source/modules/performance/WorkerPerformance.cpp b/Source/modules/performance/WorkerPerformance.cpp
index 67e77e1ba13c2cfa15a2b83fbf2ef0b584fe02c7..fae13294658593286da2a3848f1455e3fe52baee 100644
--- a/Source/modules/performance/WorkerPerformance.cpp
+++ b/Source/modules/performance/WorkerPerformance.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "modules/performance/WorkerPerformance.h"
+#include "core/timing/MemoryInfo.h"
#include "core/workers/DedicatedWorkerGlobalScope.h"
#include "core/workers/WorkerGlobalScope.h"
#include "wtf/CurrentTime.h"
@@ -54,4 +55,10 @@ double WorkerPerformance::now() const
return 1000.0 * (monotonicallyIncreasingTime() - workerGlobalScope->timeOrigin());
}
+PassRefPtr<MemoryInfo> WorkerPerformance::memory() const
+{
+ ExecutionContext* context = executionContext();
+ return MemoryInfo::create(context);
+}
+
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698