Fixes an invalid read bug in ClientSocketPoolBaseHelper and cancels ConnectJobs on network changes.
The bug seems to be running callbacks that delete the ClientSocketPoolBaseHelper object.  We need to hold onto a self-reference in the stack frame.
The new test does not crash, but will trigger invalid reads in valgrind without the fix.
The fixes are overly conservative.  At every entry point that can lead to releasing the last reference, we hold onto a self-reference.  Not all of them can currently lead to crashes since the last operation is running the callback.  But this conservative measure will help future-proof the code in case anyone adds code without thinking about it.  The references are cheap anyway.
BUG=44724

Review URL: http://codereview.chromium.org/2250001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48895 0039d316-1c4b-4281-b951-d872f2087c98
2 files changed