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

Unified Diff: content/public/test/test_browser_thread_bundle.h

Issue 22799005: Flush the blocking pool in TestBrowserThreadBundle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added documentation Created 7 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 | « content/browser/browser_thread_impl.h ('k') | content/public/test/test_browser_thread_bundle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/test_browser_thread_bundle.h
diff --git a/content/public/test/test_browser_thread_bundle.h b/content/public/test/test_browser_thread_bundle.h
index 64d30fe96a0b87e3fa60eabb06c413b186fbb043..2f4db0b960ff5ac81f214cc2dd51b4d70d71e740 100644
--- a/content/public/test/test_browser_thread_bundle.h
+++ b/content/public/test/test_browser_thread_bundle.h
@@ -17,6 +17,14 @@
// Unit tests should use base::RunLoop (e.g., base::RunLoop().RunUntilIdle()).
// TODO(phajdan.jr): Revise this comment after switch to Aura.
//
+// The TestBrowserThreadBundle will also flush the blocking pool on destruction.
+// We do this to avoid memory leaks, particularly in the case of threads posting
+// tasks to the blocking pool via PostTaskAndReply. By ensuring that the tasks
+// are run while the originating TestBroswserThreads still exist, we prevent
+// leakage of PostTaskAndReplyRelay objects. We also flush the blocking pool
+// again at the point where it would normally be shut down, to better simulate
+// the normal thread shutdown process.
+//
// Some tests using the IO thread expect a MessageLoopForIO. Passing
// IO_MAINLOOP will use a MessageLoopForIO for the main MessageLoop.
// Most of the time, this avoids needing to use a REAL_IO_THREAD.
« no previous file with comments | « content/browser/browser_thread_impl.h ('k') | content/public/test/test_browser_thread_bundle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698