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

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

Issue 667123002: Standardize usage of virtual/override/final in remoting/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/v2_authenticator.h ('k') | remoting/signaling/iq_sender.h » ('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 11 matching lines...) Expand all
22 namespace remoting { 22 namespace remoting {
23 23
24 class FakeSignalStrategy : public SignalStrategy, 24 class FakeSignalStrategy : public SignalStrategy,
25 public base::NonThreadSafe { 25 public base::NonThreadSafe {
26 public: 26 public:
27 // Calls ConenctTo() to connect |peer1| and |peer2|. Both |peer1| and |peer2| 27 // Calls ConenctTo() to connect |peer1| and |peer2|. Both |peer1| and |peer2|
28 // must belong to the current thread. 28 // must belong to the current thread.
29 static void Connect(FakeSignalStrategy* peer1, FakeSignalStrategy* peer2); 29 static void Connect(FakeSignalStrategy* peer1, FakeSignalStrategy* peer2);
30 30
31 FakeSignalStrategy(const std::string& jid); 31 FakeSignalStrategy(const std::string& jid);
32 virtual ~FakeSignalStrategy(); 32 ~FakeSignalStrategy() override;
33 33
34 const std::list<buzz::XmlElement*>& received_messages() { 34 const std::list<buzz::XmlElement*>& received_messages() {
35 return received_messages_; 35 return received_messages_;
36 } 36 }
37 37
38 // Connects current FakeSignalStrategy to receive messages from |peer|. 38 // Connects current FakeSignalStrategy to receive messages from |peer|.
39 void ConnectTo(FakeSignalStrategy* peer); 39 void ConnectTo(FakeSignalStrategy* peer);
40 40
41 // SignalStrategy interface. 41 // SignalStrategy interface.
42 virtual void Connect() override; 42 void Connect() override;
43 virtual void Disconnect() override; 43 void Disconnect() override;
44 virtual State GetState() const override; 44 State GetState() const override;
45 virtual Error GetError() const override; 45 Error GetError() const override;
46 virtual std::string GetLocalJid() const override; 46 std::string GetLocalJid() const override;
47 virtual void AddListener(Listener* listener) override; 47 void AddListener(Listener* listener) override;
48 virtual void RemoveListener(Listener* listener) override; 48 void RemoveListener(Listener* listener) override;
49 virtual bool SendStanza(scoped_ptr<buzz::XmlElement> stanza) override; 49 bool SendStanza(scoped_ptr<buzz::XmlElement> stanza) override;
50 virtual std::string GetNextId() override; 50 std::string GetNextId() override;
51 51
52 private: 52 private:
53 typedef base::Callback<void(scoped_ptr<buzz::XmlElement> message)> 53 typedef base::Callback<void(scoped_ptr<buzz::XmlElement> message)>
54 PeerCallback; 54 PeerCallback;
55 55
56 static void DeliverMessageOnThread( 56 static void DeliverMessageOnThread(
57 scoped_refptr<base::SingleThreadTaskRunner> thread, 57 scoped_refptr<base::SingleThreadTaskRunner> thread,
58 base::WeakPtr<FakeSignalStrategy> target, 58 base::WeakPtr<FakeSignalStrategy> target,
59 scoped_ptr<buzz::XmlElement> stanza); 59 scoped_ptr<buzz::XmlElement> stanza);
60 60
(...skipping 13 matching lines...) Expand all
74 std::list<buzz::XmlElement*> received_messages_; 74 std::list<buzz::XmlElement*> received_messages_;
75 75
76 base::WeakPtrFactory<FakeSignalStrategy> weak_factory_; 76 base::WeakPtrFactory<FakeSignalStrategy> weak_factory_;
77 77
78 DISALLOW_COPY_AND_ASSIGN(FakeSignalStrategy); 78 DISALLOW_COPY_AND_ASSIGN(FakeSignalStrategy);
79 }; 79 };
80 80
81 } // namespace remoting 81 } // namespace remoting
82 82
83 #endif // REMOTING_SIGNALING_FAKE_SIGNAL_STRATEGY_H_ 83 #endif // REMOTING_SIGNALING_FAKE_SIGNAL_STRATEGY_H_
OLDNEW
« no previous file with comments | « remoting/protocol/v2_authenticator.h ('k') | remoting/signaling/iq_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698