Update V8 to version 4.6.55.
[chromium-blink-merge.git] / remoting / signaling / xmpp_stream_parser.h
blob1ac5027335289fce23681ba6fb6fcc2214c99aac
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.
5 #ifndef REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_
6 #define REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_
8 #include <string>
10 #include "base/callback.h"
12 namespace buzz {
13 class XmlElement;
14 } // namespace buzz
16 namespace remoting {
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;
26 XmppStreamParser();
27 ~XmppStreamParser();
29 void SetCallbacks(const OnStanzaCallback& on_stanza_callback,
30 const base::Closure& on_error_callback);
32 void AppendData(const std::string& data);
34 private:
35 class Core;
37 scoped_ptr<Core> core_;
39 DISALLOW_COPY_AND_ASSIGN(XmppStreamParser);
42 } // namespace remoting
44 #endif // REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_