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

Unified Diff: Source/wtf/RefCountedLeakCounter.cpp

Issue 1354443003: RefCountedLeakDetector: Remove unused methods for suppressing leaks (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove include too Created 5 years, 3 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/wtf/RefCountedLeakCounter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/RefCountedLeakCounter.cpp
diff --git a/Source/wtf/RefCountedLeakCounter.cpp b/Source/wtf/RefCountedLeakCounter.cpp
index 8e389792b14734554d44c71a2fe3f19f35f19e2a..2e8ad1a46238c30c63d29e00888cb442bf68f81e 100644
--- a/Source/wtf/RefCountedLeakCounter.cpp
+++ b/Source/wtf/RefCountedLeakCounter.cpp
@@ -24,16 +24,12 @@
#if ENABLE(ASSERT)
#include "wtf/Atomics.h"
-#include "wtf/HashCountedSet.h"
#endif
namespace WTF {
#if !ENABLE(ASSERT)
-void RefCountedLeakCounter::suppressMessages(const char*) { }
-void RefCountedLeakCounter::cancelMessageSuppression(const char*) { }
-
RefCountedLeakCounter::RefCountedLeakCounter(const char*) { }
RefCountedLeakCounter::~RefCountedLeakCounter() { }
@@ -45,23 +41,6 @@ void RefCountedLeakCounter::decrement() { }
#define LOG_CHANNEL_PREFIX Log
static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn };
-typedef HashCountedSet<const char*, PtrHash<const char*>> ReasonSet;
-static ReasonSet* leakMessageSuppressionReasons;
-
-void RefCountedLeakCounter::suppressMessages(const char* reason)
-{
- if (!leakMessageSuppressionReasons)
- leakMessageSuppressionReasons = new ReasonSet;
- leakMessageSuppressionReasons->add(reason);
-}
-
-void RefCountedLeakCounter::cancelMessageSuppression(const char* reason)
-{
- ASSERT(leakMessageSuppressionReasons);
- ASSERT(leakMessageSuppressionReasons->contains(reason));
- leakMessageSuppressionReasons->remove(reason);
-}
-
RefCountedLeakCounter::RefCountedLeakCounter(const char* description)
: m_description(description)
{
@@ -69,16 +48,10 @@ RefCountedLeakCounter::RefCountedLeakCounter(const char* description)
RefCountedLeakCounter::~RefCountedLeakCounter()
{
- static bool loggedSuppressionReason;
- if (m_count) {
- if (!leakMessageSuppressionReasons || leakMessageSuppressionReasons->isEmpty())
- WTF_LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description);
- else if (!loggedSuppressionReason) {
- // This logs only one reason. Later we could change it so we log all the reasons.
- WTF_LOG(RefCountedLeaks, "No leak checking done: %s", leakMessageSuppressionReasons->begin()->key);
- loggedSuppressionReason = true;
- }
- }
+ if (!m_count)
+ return;
+
+ WTF_LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description);
}
void RefCountedLeakCounter::increment()
« no previous file with comments | « Source/wtf/RefCountedLeakCounter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698