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

Side by Side Diff: remoting/signaling/fake_signal_strategy.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
« no previous file with comments | « remoting/protocol/webrtc_video_stream.cc ('k') | remoting/signaling/fake_signal_strategy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_FAKE_SIGNAL_STRATEGY_H_ 5 #ifndef REMOTING_SIGNALING_FAKE_SIGNAL_STRATEGY_H_
6 #define REMOTING_SIGNALING_FAKE_SIGNAL_STRATEGY_H_ 6 #define REMOTING_SIGNALING_FAKE_SIGNAL_STRATEGY_H_
7 7
8 #include <list> 8 #include <list>
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 void SetLocalJid(const std::string& jid); 46 void SetLocalJid(const std::string& jid);
47 47
48 // SignalStrategy interface. 48 // SignalStrategy interface.
49 void Connect() override; 49 void Connect() override;
50 void Disconnect() override; 50 void Disconnect() override;
51 State GetState() const override; 51 State GetState() const override;
52 Error GetError() const override; 52 Error GetError() const override;
53 std::string GetLocalJid() const override; 53 std::string GetLocalJid() const override;
54 void AddListener(Listener* listener) override; 54 void AddListener(Listener* listener) override;
55 void RemoveListener(Listener* listener) override; 55 void RemoveListener(Listener* listener) override;
56 bool SendStanza(scoped_ptr<buzz::XmlElement> stanza) override; 56 bool SendStanza(std::unique_ptr<buzz::XmlElement> stanza) override;
57 std::string GetNextId() override; 57 std::string GetNextId() override;
58 58
59 private: 59 private:
60 typedef base::Callback<void(scoped_ptr<buzz::XmlElement> message)> 60 typedef base::Callback<void(std::unique_ptr<buzz::XmlElement> message)>
61 PeerCallback; 61 PeerCallback;
62 62
63 static void DeliverMessageOnThread( 63 static void DeliverMessageOnThread(
64 scoped_refptr<base::SingleThreadTaskRunner> thread, 64 scoped_refptr<base::SingleThreadTaskRunner> thread,
65 base::WeakPtr<FakeSignalStrategy> target, 65 base::WeakPtr<FakeSignalStrategy> target,
66 scoped_ptr<buzz::XmlElement> stanza); 66 std::unique_ptr<buzz::XmlElement> stanza);
67 67
68 // Called by the |peer_|. Takes ownership of |stanza|. 68 // Called by the |peer_|. Takes ownership of |stanza|.
69 void OnIncomingMessage(scoped_ptr<buzz::XmlElement> stanza); 69 void OnIncomingMessage(std::unique_ptr<buzz::XmlElement> stanza);
70 void SetPeerCallback(const PeerCallback& peer_callback); 70 void SetPeerCallback(const PeerCallback& peer_callback);
71 71
72 scoped_refptr<base::SingleThreadTaskRunner> main_thread_; 72 scoped_refptr<base::SingleThreadTaskRunner> main_thread_;
73 73
74 std::string jid_; 74 std::string jid_;
75 PeerCallback peer_callback_; 75 PeerCallback peer_callback_;
76 base::ObserverList<Listener, true> listeners_; 76 base::ObserverList<Listener, true> listeners_;
77 77
78 int last_id_; 78 int last_id_;
79 79
80 base::TimeDelta send_delay_; 80 base::TimeDelta send_delay_;
81 81
82 // All received messages, includes thouse still in |pending_messages_|. 82 // All received messages, includes thouse still in |pending_messages_|.
83 std::list<buzz::XmlElement*> received_messages_; 83 std::list<buzz::XmlElement*> received_messages_;
84 84
85 base::WeakPtrFactory<FakeSignalStrategy> weak_factory_; 85 base::WeakPtrFactory<FakeSignalStrategy> weak_factory_;
86 86
87 DISALLOW_COPY_AND_ASSIGN(FakeSignalStrategy); 87 DISALLOW_COPY_AND_ASSIGN(FakeSignalStrategy);
88 }; 88 };
89 89
90 } // namespace remoting 90 } // namespace remoting
91 91
92 #endif // REMOTING_SIGNALING_FAKE_SIGNAL_STRATEGY_H_ 92 #endif // REMOTING_SIGNALING_FAKE_SIGNAL_STRATEGY_H_
OLDNEW
« no previous file with comments | « remoting/protocol/webrtc_video_stream.cc ('k') | remoting/signaling/fake_signal_strategy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698