Support delegate deleting itself from OnError
commit157a276272c15693dcd163c54dcd63eb84af297b
authorricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 27 May 2013 13:24:33 +0000 (27 13:24 +0000)
committerricea@chromium.org <ricea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Mon, 27 May 2013 13:24:33 +0000 (27 13:24 +0000)
treec520d75ef84853a04457a8b4a45cea2027de2823
parentd9c1d6c3734ccd03fdb9e753306e0cd89ab968e6
Support delegate deleting itself from OnError

Modify SocketStream::Finish so that it works correctly if the delegate
calls DetachDelegate() and then deletes itself from within the OnError()
callback.

Test the delegate deleting itself in OnError().

SocketStream::Delegate is permitted to call
SocketStream::DetachDelegate() and then delete itself from within the
OnError method. Ensure this works correctly.

BUG=
TEST=net_unittests layout tests

Review URL: https://chromiumcodereview.appspot.com/15989003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202414 0039d316-1c4b-4281-b951-d872f2087c98
net/socket_stream/socket_stream.cc
net/socket_stream/socket_stream_unittest.cc