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

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

Issue 2393353003: Fix performance issue in InstanceCounters for DOM nodes (Closed)
Patch Set: Address on reviews Created 4 years, 2 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 077217c206d999dfb9d75907f6ba49b553385fb8..364672be2e3df798cee7c33b1712a17998dfc42f 100644
--- a/third_party/WebKit/Source/core/inspector/InstanceCounters.h
+++ b/third_party/WebKit/Source/core/inspector/InstanceCounters.h
@@ -62,17 +62,30 @@ class InstanceCounters {
};
static inline void incrementCounter(CounterType type) {
+ DCHECK_NE(type, NodeCounter);
atomicIncrement(&s_counters[type]);
}
static inline void decrementCounter(CounterType type) {
+ DCHECK_NE(type, NodeCounter);
atomicDecrement(&s_counters[type]);
}
+ static inline void incrementNodeCounter() {
+ DCHECK(isMainThread());
+ s_nodeCounter++;
+ }
+
+ static inline void decrementNodeCounter() {
+ DCHECK(isMainThread());
+ s_nodeCounter--;
+ }
+
CORE_EXPORT static int counterValue(CounterType);
private:
CORE_EXPORT static int s_counters[CounterTypeLength];
+ CORE_EXPORT static int s_nodeCounter;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/Node.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