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

Unified Diff: remoting/signaling/xmpp_stream_parser.h

Issue 958703003: Remove dependency on XMPP implementation in WebRTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/signaling/xmpp_signal_strategy_unittest.cc ('k') | remoting/signaling/xmpp_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/signaling/xmpp_stream_parser.h
diff --git a/remoting/signaling/xmpp_stream_parser.h b/remoting/signaling/xmpp_stream_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..1ac5027335289fce23681ba6fb6fcc2214c99aac
--- /dev/null
+++ b/remoting/signaling/xmpp_stream_parser.h
@@ -0,0 +1,44 @@
+// Copyright 2015 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 REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_
+#define REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_
+
+#include <string>
+
+#include "base/callback.h"
+
+namespace buzz {
+class XmlElement;
+} // namespace buzz
+
+namespace remoting {
+
+// XmppStreamParser is used to parse XMPP stream. Data is fed to the parser
+// using appendData() method and it calls |on_stanza_callback\ and
+// |on_error_callback| specified using SetCallbacks().
+class XmppStreamParser {
+ public:
+ typedef base::Callback<void(scoped_ptr<buzz::XmlElement> stanza)>
+ OnStanzaCallback;
+
+ XmppStreamParser();
+ ~XmppStreamParser();
+
+ void SetCallbacks(const OnStanzaCallback& on_stanza_callback,
+ const base::Closure& on_error_callback);
+
+ void AppendData(const std::string& data);
+
+ private:
+ class Core;
+
+ scoped_ptr<Core> core_;
+
+ DISALLOW_COPY_AND_ASSIGN(XmppStreamParser);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_
« no previous file with comments | « remoting/signaling/xmpp_signal_strategy_unittest.cc ('k') | remoting/signaling/xmpp_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698