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

Unified Diff: base/tracked_objects.cc

Issue 16387012: Annotate the intentional test-only leak in base/tracked_objects.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another refresh. Created 7 years, 6 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 | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects.cc
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc
index 55c1ffe55a5e5371613e8dfc2ee811cee56a1c7d..4449d72065e3a384e801aaf9a9d4f1bc36796920 100644
--- a/base/tracked_objects.cc
+++ b/base/tracked_objects.cc
@@ -8,6 +8,7 @@
#include <stdlib.h>
#include "base/compiler_specific.h"
+#include "base/debug/leak_annotations.h"
#include "base/format_macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/process_util.h"
@@ -808,8 +809,14 @@ void ThreadData::ShutdownSingleThreadedCleanup(bool leak) {
// To avoid any chance of racing in unit tests, which is the only place we
// call this function, we may sometimes leak all the data structures we
// recovered, as they may still be in use on threads from prior tests!
- if (leak)
+ if (leak) {
+ ThreadData* thread_data = thread_data_list;
+ while (thread_data) {
+ ANNOTATE_LEAKING_OBJECT_PTR(thread_data);
+ thread_data = thread_data->next();
+ }
return;
+ }
// When we want to cleanup (on a single thread), here is what we do.
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698