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

Unified Diff: net/url_request/url_request_context_getter.cc

Issue 10857008: Added warning when URLRequestContextGetter leaks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed extraneous blank line. Created 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_context_getter.cc
diff --git a/net/url_request/url_request_context_getter.cc b/net/url_request/url_request_context_getter.cc
index db73fe3705f1e3016ed94993d757e3866c9b65cc..4cd9e3800f2510295a980a7d6622f3cec2394b91 100644
--- a/net/url_request/url_request_context_getter.cc
+++ b/net/url_request/url_request_context_getter.cc
@@ -22,7 +22,12 @@ void URLRequestContextGetter::OnDestruct() const {
if (network_task_runner->BelongsToCurrentThread()) {
delete this;
} else {
- network_task_runner->DeleteSoon(FROM_HERE, this);
+ if (!network_task_runner->DeleteSoon(FROM_HERE, this)) {
+ // Can't force-delete the object here, because some derived classes
eroman 2012/08/15 18:00:44 Please change the language to not reference chrome
Andrew T Wilson (Slow) 2012/08/15 18:07:17 Ah, good point. I'll do this.
+ // (like ShellURLRequestContextGetter) may only be deleted on the IO
+ // thread.
+ DLOG(WARNING) << "URLRequestContextGetter leaking due to no IO thread.";
eroman 2012/08/15 18:00:44 How about making this simply LOG(WARNING)?
Andrew T Wilson (Slow) 2012/08/15 18:07:17 Since this really only impacts unit tests, I figur
+ }
}
}
// If no IO message loop proxy was available, we will just leak memory.
« 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