| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_ |
| 6 #define REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/callback.h" |
| 11 |
| 12 namespace buzz { |
| 13 class XmlElement; |
| 14 } // namespace buzz |
| 15 |
| 16 namespace remoting { |
| 17 |
| 18 // XmppStreamParser is used to parse XMPP stream. Data is fed to the parser |
| 19 // using appendData() method and it calls |on_stanza_callback\ and |
| 20 // |on_error_callback| specified using SetCallbacks(). |
| 21 class XmppStreamParser { |
| 22 public: |
| 23 typedef base::Callback<void(scoped_ptr<buzz::XmlElement> stanza)> |
| 24 OnStanzaCallback; |
| 25 |
| 26 XmppStreamParser(); |
| 27 ~XmppStreamParser(); |
| 28 |
| 29 void SetCallbacks(const OnStanzaCallback& on_stanza_callback, |
| 30 const base::Closure& on_error_callback); |
| 31 |
| 32 void AppendData(const std::string& data); |
| 33 |
| 34 private: |
| 35 class Core; |
| 36 |
| 37 scoped_ptr<Core> core_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(XmppStreamParser); |
| 40 }; |
| 41 |
| 42 } // namespace remoting |
| 43 |
| 44 #endif // REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_ |
| OLD | NEW |