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

Unified Diff: third_party/WebKit/Source/core/inspector/InstanceCounters.h

Issue 2258873004: Leak Detector: Count ScriptPromise and ActiveDOMObject on worker threads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix: Build fail on ChromeOS Created 4 years, 4 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
Index: third_party/WebKit/Source/core/inspector/InstanceCounters.h
diff --git a/third_party/WebKit/Source/core/inspector/InstanceCounters.h b/third_party/WebKit/Source/core/inspector/InstanceCounters.h
index 691dd1c58a64b25e1874d23ed5a51226846480d6..e23e850852cc4a420e0d9f25e6eb0b21af9dcb59 100644
--- a/third_party/WebKit/Source/core/inspector/InstanceCounters.h
+++ b/third_party/WebKit/Source/core/inspector/InstanceCounters.h
@@ -33,6 +33,7 @@
#include "core/CoreExport.h"
#include "wtf/Allocator.h"
+#include "wtf/Atomics.h"
#if ENABLE(ASSERT)
#endif
@@ -60,14 +61,12 @@ public:
static inline void incrementCounter(CounterType type)
{
- ASSERT(isMainThread());
- ++s_counters[type];
+ atomicIncrement(&s_counters[type]);
}
static inline void decrementCounter(CounterType type)
{
- ASSERT(isMainThread());
- --s_counters[type];
+ atomicDecrement(&s_counters[type]);
}
CORE_EXPORT static int counterValue(CounterType);
« no previous file with comments | « third_party/WebKit/Source/core/dom/ActiveDOMObject.cpp ('k') | third_party/WebKit/Source/core/inspector/InstanceCounters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698