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

Unified Diff: content/browser/browser_thread.h

Issue 6691044: Encourage reliability of code using browser thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Turn off fatal as it caused problem in tests Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_thread.h
diff --git a/content/browser/browser_thread.h b/content/browser/browser_thread.h
index 8a67f3ded4a9be93a6b9cf10d6be9bba26a8caed..b54f5fe34c25622fb3c06ea6101bf7a544338ab1 100644
--- a/content/browser/browser_thread.h
+++ b/content/browser/browser_thread.h
@@ -6,6 +6,9 @@
#define CONTENT_BROWSER_BROWSER_THREAD_H_
#pragma once
+#if defined(UNIT_TEST)
+#include "base/logging.h"
+#endif // UNIT_TEST
#include "base/synchronization/lock.h"
#include "base/task.h"
#include "base/threading/thread.h"
@@ -161,7 +164,13 @@ class BrowserThread : public base::Thread {
if (CurrentlyOn(thread)) {
delete x;
} else {
- DeleteSoon(thread, FROM_HERE, x);
+ if (!DeleteSoon(thread, FROM_HERE, x)) {
+#if defined(UNIT_TEST)
+ // Only logged under unit testing because leaks at shutdown
+ // are acceptable under normal circumstances.
+ LOG(ERROR) << "DeleteSoon failed on thread " << thread;
+#endif // UNIT_TEST
+ }
}
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698