| Index: third_party/xmpp/xmpppump.h
|
| diff --git a/third_party/xmpp/xmpppump.h b/third_party/xmpp/xmpppump.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f43f6d082ac058b1827031d4aac168f25a7b5cb9
|
| --- /dev/null
|
| +++ b/third_party/xmpp/xmpppump.h
|
| @@ -0,0 +1,56 @@
|
| +// Copyright 2004 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef WEBRTC_LIBJINGLE_XMPP_XMPPPUMP_H_
|
| +#define WEBRTC_LIBJINGLE_XMPP_XMPPPUMP_H_
|
| +
|
| +#include "third_party/xmpp/xmppclient.h"
|
| +#include "third_party/xmpp/xmppengine.h"
|
| +#include "third_party/xmpp/xmpptask.h"
|
| +#include "webrtc/base/messagequeue.h"
|
| +#include "webrtc/base/taskrunner.h"
|
| +#include "webrtc/base/thread.h"
|
| +#include "webrtc/base/timeutils.h"
|
| +
|
| +namespace buzz {
|
| +
|
| +// Simple xmpp pump
|
| +
|
| +class XmppPumpNotify {
|
| +public:
|
| + virtual ~XmppPumpNotify() {}
|
| + virtual void OnStateChange(buzz::XmppEngine::State state) = 0;
|
| +};
|
| +
|
| +class XmppPump : public rtc::MessageHandler, public rtc::TaskRunner {
|
| +public:
|
| + XmppPump(buzz::XmppPumpNotify * notify = NULL);
|
| +
|
| + buzz::XmppClient *client() { return client_; }
|
| +
|
| + void DoLogin(const buzz::XmppClientSettings & xcs,
|
| + buzz::AsyncSocket* socket,
|
| + buzz::PreXmppAuth* auth);
|
| + void DoDisconnect();
|
| +
|
| + void OnStateChange(buzz::XmppEngine::State state);
|
| +
|
| + void WakeTasks();
|
| +
|
| + int64_t CurrentTime();
|
| +
|
| + void OnMessage(rtc::Message *pmsg);
|
| +
|
| + buzz::XmppReturnStatus SendStanza(const buzz::XmlElement *stanza);
|
| +
|
| +private:
|
| + buzz::XmppClient *client_;
|
| + buzz::XmppEngine::State state_;
|
| + buzz::XmppPumpNotify *notify_;
|
| +};
|
| +
|
| +} // namespace buzz
|
| +
|
| +#endif // WEBRTC_LIBJINGLE_XMPP_XMPPPUMP_H_
|
| +
|
|
|