| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 5 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" | 8 #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" |
| 9 #include "remoting/jingle_glue/jingle_thread.h" | 9 #include "remoting/jingle_glue/jingle_thread.h" |
| 10 #include "remoting/jingle_glue/xmpp_iq_request.h" | 10 #include "remoting/jingle_glue/xmpp_iq_request.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 : thread_(jingle_thread), | 22 : thread_(jingle_thread), |
| 23 listener_(NULL), | 23 listener_(NULL), |
| 24 username_(username), | 24 username_(username), |
| 25 auth_token_(auth_token), | 25 auth_token_(auth_token), |
| 26 auth_token_service_(auth_token_service), | 26 auth_token_service_(auth_token_service), |
| 27 xmpp_client_(NULL), | 27 xmpp_client_(NULL), |
| 28 observer_(NULL) { | 28 observer_(NULL) { |
| 29 } | 29 } |
| 30 | 30 |
| 31 XmppSignalStrategy::~XmppSignalStrategy() { | 31 XmppSignalStrategy::~XmppSignalStrategy() { |
| 32 if (xmpp_client_) | |
| 33 xmpp_client_->engine()->RemoveStanzaHandler(this); | |
| 34 | |
| 35 DCHECK(listener_ == NULL); | 32 DCHECK(listener_ == NULL); |
| 33 Close(); |
| 36 } | 34 } |
| 37 | 35 |
| 38 void XmppSignalStrategy::Init(StatusObserver* observer) { | 36 void XmppSignalStrategy::Init(StatusObserver* observer) { |
| 39 observer_ = observer; | 37 observer_ = observer; |
| 40 | 38 |
| 41 buzz::Jid login_jid(username_); | 39 buzz::Jid login_jid(username_); |
| 42 | 40 |
| 43 buzz::XmppClientSettings settings; | 41 buzz::XmppClientSettings settings; |
| 44 settings.set_user(login_jid.node()); | 42 settings.set_user(login_jid.node()); |
| 45 settings.set_host(login_jid.domain()); | 43 settings.set_host(login_jid.domain()); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 126 } |
| 129 | 127 |
| 130 return new notifier::GaiaTokenPreXmppAuth( | 128 return new notifier::GaiaTokenPreXmppAuth( |
| 131 jid.Str(), | 129 jid.Str(), |
| 132 settings.auth_cookie(), | 130 settings.auth_cookie(), |
| 133 settings.token_service(), | 131 settings.token_service(), |
| 134 mechanism); | 132 mechanism); |
| 135 } | 133 } |
| 136 | 134 |
| 137 } // namespace remoting | 135 } // namespace remoting |
| OLD | NEW |