DescriptionAdd checks to DEBUG mode that no instance of URLRequest or URLFetcher survives the destruction of the IO thread.
This checking is done by introducing a new helper class to base called LeakTracker. Classes that you want to check for leaks just need to extend LeakTracker.
The reason I am picking on URLFetcher / URLRequest, is I believe we have a bug that is making an instance of URLFetcher to outlive the IO thread.
This causes various sorts of badness.
For example:
If URLFetcher survives the IO thread, then URLRequestContext remains referenced and therefore also survives IO thread. In turn HostResolverImpl survives the IO thread, so any outstanding resolve requests are NOT cancelled before the IO thread is decomissioned. So now, when the worker thread doing the DNS resolve finally finishes (assuming it finishes before the rogue URLRequest is destroyed), it post the result to a defunct message loop. KAB00m! (http://crbug.com/15513)
Moreover, I believe we hit this same problem sporadically in AutomationProxyTest.AutocompleteGetSetText -- the test is flaky on the buildbots, and I've seen DCHECKs which suggest it is related to this issue.
BUG=http://crbug.com/18372
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=23084
Patch Set 1 #Patch Set 2 : Update some comments #Patch Set 3 : move into base:: #
Total comments: 10
Patch Set 4 : Address darin's comments #Patch Set 5 : style-nit: Remove an empty line #Patch Set 6 : Chain CleanUp #Patch Set 7 : Add call to Stop() in dtor -- this still doesnt work #Patch Set 8 : remove todo comment #Patch Set 9 : add back something which got accidentally deleted #
Total comments: 2
Patch Set 10 : Address darin's comments #Patch Set 11 : Improve some comments #
Total comments: 4
Patch Set 12 : Fix a blatant compile error #Patch Set 13 : Add a no-op CheckForLeaks test #Patch Set 14 : Sync client #
Messages
Total messages: 13 (0 generated)
|