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

Side by Side Diff: remoting/signaling/xmpp_stream_parser.h

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_ 5 #ifndef REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_
6 #define REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_ 6 #define REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_
7 7
8 #include <memory>
8 #include <string> 9 #include <string>
9 10
10 #include "base/callback.h" 11 #include "base/callback.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 13
14 namespace buzz { 14 namespace buzz {
15 class XmlElement; 15 class XmlElement;
16 } // namespace buzz 16 } // namespace buzz
17 17
18 namespace remoting { 18 namespace remoting {
19 19
20 // XmppStreamParser is used to parse XMPP stream. Data is fed to the parser 20 // XmppStreamParser is used to parse XMPP stream. Data is fed to the parser
21 // using appendData() method and it calls |on_stanza_callback\ and 21 // using appendData() method and it calls |on_stanza_callback\ and
22 // |on_error_callback| specified using SetCallbacks(). 22 // |on_error_callback| specified using SetCallbacks().
23 class XmppStreamParser { 23 class XmppStreamParser {
24 public: 24 public:
25 typedef base::Callback<void(scoped_ptr<buzz::XmlElement> stanza)> 25 typedef base::Callback<void(std::unique_ptr<buzz::XmlElement> stanza)>
26 OnStanzaCallback; 26 OnStanzaCallback;
27 27
28 XmppStreamParser(); 28 XmppStreamParser();
29 ~XmppStreamParser(); 29 ~XmppStreamParser();
30 30
31 void SetCallbacks(const OnStanzaCallback& on_stanza_callback, 31 void SetCallbacks(const OnStanzaCallback& on_stanza_callback,
32 const base::Closure& on_error_callback); 32 const base::Closure& on_error_callback);
33 33
34 void AppendData(const std::string& data); 34 void AppendData(const std::string& data);
35 35
36 private: 36 private:
37 class Core; 37 class Core;
38 38
39 scoped_ptr<Core> core_; 39 std::unique_ptr<Core> core_;
40 40
41 DISALLOW_COPY_AND_ASSIGN(XmppStreamParser); 41 DISALLOW_COPY_AND_ASSIGN(XmppStreamParser);
42 }; 42 };
43 43
44 } // namespace remoting 44 } // namespace remoting
45 45
46 #endif // REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_ 46 #endif // REMOTING_SIGNALING_XMPP_STREAM_PARSER_H_
OLDNEW
« 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