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

Unified Diff: Source/core/timing/MemoryInfo.cpp

Issue 106353005: Expose performance.memory in workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@Perf-Memory-SharedWorker
Patch Set: Created 6 years, 7 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/core/timing/MemoryInfo.h ('k') | Source/core/timing/Performance.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/timing/MemoryInfo.cpp
diff --git a/Source/core/timing/MemoryInfo.cpp b/Source/core/timing/MemoryInfo.cpp
index 65b2fdc9c0bdfcd5260d880fd2300b74f3536dd1..e6285ee5dddde95e2739b04866fa48573ac6189f 100644
--- a/Source/core/timing/MemoryInfo.cpp
+++ b/Source/core/timing/MemoryInfo.cpp
@@ -31,6 +31,7 @@
#include "config.h"
#include "core/timing/MemoryInfo.h"
+#include "RuntimeEnabledFeatures.h"
#include <limits>
#include "core/frame/LocalFrame.h"
#include "core/frame/Settings.h"
@@ -90,7 +91,6 @@ size_t quantizeMemorySize(size_t size)
const int numberOfBuckets = 100;
DEFINE_STATIC_LOCAL(Vector<size_t>, bucketSizeList, ());
- ASSERT(isMainThread());
if (bucketSizeList.isEmpty()) {
bucketSizeList.resize(numberOfBuckets);
@@ -130,14 +130,11 @@ size_t quantizeMemorySize(size_t size)
return bucketSizeList[numberOfBuckets - 1];
}
-
-MemoryInfo::MemoryInfo(LocalFrame* frame)
+MemoryInfo::MemoryInfo()
{
ScriptWrappable::init(this);
- if (!frame || !frame->settings())
- return;
- if (frame->settings()->preciseMemoryInfoEnabled()) {
+ if (RuntimeEnabledFeatures::preciseMemoryInfoEnabled()) {
ScriptGCEvent::getHeapSize(m_info);
} else {
DEFINE_STATIC_LOCAL(HeapSizeCache, heapSizeCache, ());
yurys 2014/12/24 08:23:29 HeapSizeCache should become thread-local as it now
« no previous file with comments | « Source/core/timing/MemoryInfo.h ('k') | Source/core/timing/Performance.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698