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

Unified Diff: Source/modules/webaudio/AudioNode.cpp

Issue 450183002: Add instance counters of Resource and AudioNode, and expose them via WebLeakDetector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | Source/web/WebLeakDetector.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/webaudio/AudioNode.cpp
diff --git a/Source/modules/webaudio/AudioNode.cpp b/Source/modules/webaudio/AudioNode.cpp
index c8ba5e8dcd472311ef9684d7fd2f0a4ce18b9063..4c0c9d51ca4c780061835b9279146c08476825b0 100644
--- a/Source/modules/webaudio/AudioNode.cpp
+++ b/Source/modules/webaudio/AudioNode.cpp
@@ -43,6 +43,8 @@
namespace blink {
+unsigned AudioNode::s_instanceCount = 0;
+
AudioNode::AudioNode(AudioContext* context, float sampleRate)
: m_isInitialized(false)
, m_nodeType(NodeTypeUnknown)
@@ -70,10 +72,12 @@ AudioNode::AudioNode(AudioContext* context, float sampleRate)
atexit(AudioNode::printNodeCounts);
}
#endif
+ ++s_instanceCount;
}
AudioNode::~AudioNode()
{
+ --s_instanceCount;
#if DEBUG_AUDIONODE_REFERENCES
--s_nodeCount[nodeType()];
#if ENABLE(OILPAN)
« no previous file with comments | « Source/modules/webaudio/AudioNode.h ('k') | Source/web/WebLeakDetector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698