commit | 8585b207dc9502256c2a428611e948e105db96b6 | [log] [tgz] |
---|---|---|
author | Paul Stewart <pstew@chromium.org> | Fri Sep 21 14:03:01 2012 -0700 |
committer | Gerrit <chrome-bot@google.com> | Wed Sep 26 18:59:57 2012 -0700 |
tree | 13a865f67af3dc0be2443966508fedfc2154268b | |
parent | a6bfe87a2c0bcb68d789473ca10988243229667b [diff] |
shill: AsyncConnection: Call callback last ..since it may actually end up deleting the AsyncConnection. For example, this happens in the HTTPRequest callback: HTTPRequest::OnConnectCompletion(false, -1) HTTPRequest::SendStatus(kResultConnectionFailure) result_callback.Run() in the case of portal detector resolves to... PortalDetector::RequestResultCallback() PortalDetector::CompleteAttempt() PortalDetector::Stop() request_.reset() this frees the AsyncConnection as well, since it is owned by the HTTPRequest. As such this is only safe if OnConnectCompletion does not do anything more with |this| when the callback returns. BUG=chromium-os:34655 TEST=Unit tests Change-Id: I37056c5f2a330409920f117ebeb4e40c5366593e Reviewed-on: https://gerrit.chromium.org/gerrit/33800 Reviewed-by: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org> Commit-Ready: Paul Stewart <pstew@chromium.org>