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

Side by Side Diff: third_party/WebKit/Source/wtf/RefCountedLeakCounter.cpp

Issue 1807853003: Deprecate some macros in wtf/Assertions.h in favor of base/logging.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 19 matching lines...) Expand all
30 #if !ENABLE(ASSERT) 30 #if !ENABLE(ASSERT)
31 31
32 RefCountedLeakCounter::RefCountedLeakCounter(const char*) { } 32 RefCountedLeakCounter::RefCountedLeakCounter(const char*) { }
33 RefCountedLeakCounter::~RefCountedLeakCounter() { } 33 RefCountedLeakCounter::~RefCountedLeakCounter() { }
34 34
35 void RefCountedLeakCounter::increment() { } 35 void RefCountedLeakCounter::increment() { }
36 void RefCountedLeakCounter::decrement() { } 36 void RefCountedLeakCounter::decrement() { }
37 37
38 #else 38 #else
39 39
40 #define LOG_CHANNEL_PREFIX Log
41 static WTFLogChannel LogRefCountedLeaks = { WTFLogChannelOn };
42
43 RefCountedLeakCounter::RefCountedLeakCounter(const char* description) 40 RefCountedLeakCounter::RefCountedLeakCounter(const char* description)
44 : m_description(description) 41 : m_description(description)
45 { 42 {
46 } 43 }
47 44
48 RefCountedLeakCounter::~RefCountedLeakCounter() 45 RefCountedLeakCounter::~RefCountedLeakCounter()
49 { 46 {
50 if (!m_count) 47 if (!m_count)
51 return; 48 return;
52 49
53 WTF_LOG(RefCountedLeaks, "LEAK: %u %s", m_count, m_description); 50 VLOG(0) << "LEAK: " << m_count << " " << m_description;
54 } 51 }
55 52
56 void RefCountedLeakCounter::increment() 53 void RefCountedLeakCounter::increment()
57 { 54 {
58 atomicIncrement(&m_count); 55 atomicIncrement(&m_count);
59 } 56 }
60 57
61 void RefCountedLeakCounter::decrement() 58 void RefCountedLeakCounter::decrement()
62 { 59 {
63 atomicDecrement(&m_count); 60 atomicDecrement(&m_count);
64 } 61 }
65 62
66 #endif 63 #endif
67 64
68 } // namespace WTF 65 } // namespace WTF
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698