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 |