Fix XmppLoginHandler to handle destruction from delegate methods.
commit56988978ff675e340927da78f65c123f8b6a0008
authorsergeyu <sergeyu@chromium.org>
Thu, 11 Jun 2015 02:23:35 +0000 (10 19:23 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 11 Jun 2015 02:24:10 +0000 (11 02:24 +0000)
tree673f3bb6d8919c55c0bab104363ded2e0f5b2dc8
parent8314b5f3b3da64d28039ecea71b48db7ce028ed3
Fix XmppLoginHandler to handle destruction from delegate methods.

XmppLoginHandler was crashing when it's destroyed from SendMessage().
E.g. it can happen when Write() fails after TLS handshake. Also added
unittests to test this scenario.

BUG=498989

Review URL: https://codereview.chromium.org/1179543004

Cr-Commit-Position: refs/heads/master@{#333877}
remoting/signaling/xmpp_login_handler.cc
remoting/signaling/xmpp_login_handler.h
remoting/signaling/xmpp_login_handler_unittest.cc