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

Unified Diff: base/tracked_objects.h

Issue 8432003: Reduce leaking in object tracking tests (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 2 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 | base/tracked_objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/tracked_objects.h
===================================================================
--- base/tracked_objects.h (revision 107938)
+++ base/tracked_objects.h (working copy)
@@ -711,12 +711,16 @@
// the code).
static TrackedTime Now();
- // WARNING: ONLY call this function when you are running single threaded
- // (again) and all message loops and threads have terminated. Until that
- // point some threads may still attempt to write into our data structures.
- // Delete recursively all data structures, starting with the list of
+ // Cleans up data structures, and returns statics to near pristine (mostly
+ // uninitialized) state. If there is any chance that other threads are still
+ // using the data structures, then the |leak| argument should be passed in as
+ // true, and the data structures (birth maps, death maps, ThreadData
+ // insntances, etc.) will be leaked and not deleted. If you have joined all
+ // threads since the time that InitializeAndSetTrackingStatus() was called,
+ // then you can pass in a |leak| value of false, and this function will
+ // delete recursively all data structures, starting with the list of
// ThreadData instances.
- static void ShutdownSingleThreadedCleanup();
+ static void ShutdownSingleThreadedCleanup(bool leak);
private:
typedef std::stack<const ThreadData*> ThreadDataPool;
« no previous file with comments | « no previous file | base/tracked_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698