Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: remoting/signaling/xmpp_login_handler.h

Issue 1179543004: Fix XmppLoginHandler to handle destruction from delegate methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | remoting/signaling/xmpp_login_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ 5 #ifndef REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_
6 #define REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ 6 #define REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 17 matching lines...) Expand all
28 // to send outgoing messages and calls Delegate::OnHandshakeDone() after 28 // to send outgoing messages and calls Delegate::OnHandshakeDone() after
29 // authentication is finished successfully or Delegate::OnError() on error. 29 // authentication is finished successfully or Delegate::OnError() on error.
30 // 30 //
31 // See RFC3920 for description of XMPP and authentication handshake. 31 // See RFC3920 for description of XMPP and authentication handshake.
32 class XmppLoginHandler { 32 class XmppLoginHandler {
33 public: 33 public:
34 class Delegate { 34 class Delegate {
35 public: 35 public:
36 Delegate() {} 36 Delegate() {}
37 37
38 // All Delegate methods are allowed to destroy XmppLoginHandler.
38 virtual void SendMessage(const std::string& message) = 0; 39 virtual void SendMessage(const std::string& message) = 0;
39 virtual void StartTls() = 0; 40 virtual void StartTls() = 0;
40 virtual void OnHandshakeDone(const std::string& jid, 41 virtual void OnHandshakeDone(const std::string& jid,
41 scoped_ptr<XmppStreamParser> parser) = 0; 42 scoped_ptr<XmppStreamParser> parser) = 0;
42 virtual void OnLoginHandlerError(SignalStrategy::Error error) = 0; 43 virtual void OnLoginHandlerError(SignalStrategy::Error error) = 0;
43 44
44 protected: 45 protected:
45 virtual ~Delegate() {} 46 virtual ~Delegate() {}
46 }; 47 };
47 48
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 std::string jid_; 134 std::string jid_;
134 135
135 scoped_ptr<XmppStreamParser> stream_parser_; 136 scoped_ptr<XmppStreamParser> stream_parser_;
136 137
137 DISALLOW_COPY_AND_ASSIGN(XmppLoginHandler); 138 DISALLOW_COPY_AND_ASSIGN(XmppLoginHandler);
138 }; 139 };
139 140
140 } // namespace remoting 141 } // namespace remoting
141 142
142 #endif // REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_ 143 #endif // REMOTING_SIGNALING_XMPP_LOGIN_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/signaling/xmpp_login_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698