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

Side by Side Diff: third_party/libjingle_xmpp/xmpp/xmpplogintask.h

Issue 2443903004: Add xmllite and xmpp sources to third_party/ (Closed)
Patch Set: Explicitly use webrtc_overrides/webrtc/base/logging.h Created 3 years, 11 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
OLDNEW
(Empty)
1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_LIBJINGLE_XMPP_LOGINTASK_H_
12 #define WEBRTC_LIBJINGLE_XMPP_LOGINTASK_H_
13
14 #include <memory>
15 #include <string>
16 #include <vector>
17
18 #include "third_party/libjingle_xmpp/xmpp/jid.h"
19 #include "third_party/libjingle_xmpp/xmpp/xmppengine.h"
20 #include "third_party/webrtc_overrides/webrtc/base/logging.h"
21
22 namespace buzz {
23
24 class XmlElement;
25 class XmppEngineImpl;
26 class SaslMechanism;
27
28
29 // TODO: Rename to LoginTask.
30 class XmppLoginTask {
31
32 public:
33 XmppLoginTask(XmppEngineImpl *pctx);
34 ~XmppLoginTask();
35
36 bool IsDone()
37 { return state_ == LOGINSTATE_DONE; }
38 void IncomingStanza(const XmlElement * element, bool isStart);
39 void OutgoingStanza(const XmlElement *element);
40 void set_allow_non_google_login(bool b)
41 { allowNonGoogleLogin_ = b; }
42
43 private:
44 enum LoginTaskState {
45 LOGINSTATE_INIT = 0,
46 LOGINSTATE_STREAMSTART_SENT,
47 LOGINSTATE_STARTED_XMPP,
48 LOGINSTATE_TLS_INIT,
49 LOGINSTATE_AUTH_INIT,
50 LOGINSTATE_BIND_INIT,
51 LOGINSTATE_TLS_REQUESTED,
52 LOGINSTATE_SASL_RUNNING,
53 LOGINSTATE_BIND_REQUESTED,
54 LOGINSTATE_SESSION_REQUESTED,
55 LOGINSTATE_DONE,
56 };
57
58 const XmlElement * NextStanza();
59 bool Advance();
60 bool HandleStartStream(const XmlElement * element);
61 bool HandleFeatures(const XmlElement * element);
62 const XmlElement * GetFeature(const QName & name);
63 bool Failure(XmppEngine::Error reason);
64 void FlushQueuedStanzas();
65
66 XmppEngineImpl * pctx_;
67 bool authNeeded_;
68 bool allowNonGoogleLogin_;
69 LoginTaskState state_;
70 const XmlElement * pelStanza_;
71 bool isStart_;
72 std::string iqId_;
73 std::unique_ptr<XmlElement> pelFeatures_;
74 Jid fullJid_;
75 std::string streamId_;
76 std::unique_ptr<std::vector<XmlElement *> > pvecQueuedStanzas_;
77
78 std::unique_ptr<SaslMechanism> sasl_mech_;
79
80 #if !defined(NDEBUG)
81 static const rtc::ConstantLabel LOGINTASK_STATES[];
82 #endif
83 };
84
85 }
86
87 #endif // WEBRTC_LIBJINGLE_XMPP_LOGINTASK_H_
OLDNEW
« no previous file with comments | « third_party/libjingle_xmpp/xmpp/xmppengineimpl_iq.cc ('k') | third_party/libjingle_xmpp/xmpp/xmpplogintask.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698