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

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

Issue 2911893003: Deprecate NonThreadSafe in remoting in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 6 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/signaling/fake_signal_strategy.cc ('k') | remoting/signaling/log_to_server.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_LOG_TO_SERVER_H_ 5 #ifndef REMOTING_SIGNALING_LOG_TO_SERVER_H_
6 #define REMOTING_SIGNALING_LOG_TO_SERVER_H_ 6 #define REMOTING_SIGNALING_LOG_TO_SERVER_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/threading/non_thread_safe.h" 13 #include "base/sequence_checker.h"
14 #include "remoting/signaling/server_log_entry.h" 14 #include "remoting/signaling/server_log_entry.h"
15 #include "remoting/signaling/signal_strategy.h" 15 #include "remoting/signaling/signal_strategy.h"
16 16
17 namespace buzz { 17 namespace buzz {
18 class XmlElement; 18 class XmlElement;
19 } // namespace buzz 19 } // namespace buzz
20 20
21 namespace remoting { 21 namespace remoting {
22 22
23 class IqSender; 23 class IqSender;
24 24
25 // LogToServer sends log entries to a server. 25 // LogToServer sends log entries to a server.
26 // The contents of the log entries are described in server_log_entry.cc. 26 // The contents of the log entries are described in server_log_entry.cc.
27 // They do not contain any personally identifiable information. 27 // They do not contain any personally identifiable information.
28 class LogToServer : public base::NonThreadSafe, 28 class LogToServer : public SignalStrategy::Listener {
29 public SignalStrategy::Listener {
30 public: 29 public:
31 LogToServer(ServerLogEntry::Mode mode, 30 LogToServer(ServerLogEntry::Mode mode,
32 SignalStrategy* signal_strategy, 31 SignalStrategy* signal_strategy,
33 const std::string& directory_bot_jid); 32 const std::string& directory_bot_jid);
34 ~LogToServer() override; 33 ~LogToServer() override;
35 34
36 // SignalStrategy::Listener interface. 35 // SignalStrategy::Listener interface.
37 void OnSignalStrategyStateChange(SignalStrategy::State state) override; 36 void OnSignalStrategyStateChange(SignalStrategy::State state) override;
38 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override; 37 bool OnSignalStrategyIncomingStanza(const buzz::XmlElement* stanza) override;
39 38
40 void Log(const ServerLogEntry& entry); 39 void Log(const ServerLogEntry& entry);
41 40
42 ServerLogEntry::Mode mode() { return mode_; } 41 ServerLogEntry::Mode mode() { return mode_; }
43 42
44 private: 43 private:
45 void SendPendingEntries(); 44 void SendPendingEntries();
46 45
47 ServerLogEntry::Mode mode_; 46 ServerLogEntry::Mode mode_;
48 SignalStrategy* signal_strategy_; 47 SignalStrategy* signal_strategy_;
49 std::unique_ptr<IqSender> iq_sender_; 48 std::unique_ptr<IqSender> iq_sender_;
50 std::string directory_bot_jid_; 49 std::string directory_bot_jid_;
51 50
52 std::deque<ServerLogEntry> pending_entries_; 51 std::deque<ServerLogEntry> pending_entries_;
53 52
53 SEQUENCE_CHECKER(sequence_checker_);
54
54 DISALLOW_COPY_AND_ASSIGN(LogToServer); 55 DISALLOW_COPY_AND_ASSIGN(LogToServer);
55 }; 56 };
56 57
57 } // namespace remoting 58 } // namespace remoting
58 59
59 #endif // REMOTING_SIGNALING_LOG_TO_SERVER_H_ 60 #endif // REMOTING_SIGNALING_LOG_TO_SERVER_H_
OLDNEW
« no previous file with comments | « remoting/signaling/fake_signal_strategy.cc ('k') | remoting/signaling/log_to_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698