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

Side by Side Diff: remoting/protocol/stream_channel_factory.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_PROTOCOL_STREAM_CHANNEL_FACTORY_H_ 5 #ifndef REMOTING_PROTOCOL_STREAM_CHANNEL_FACTORY_H_
6 #define REMOTING_PROTOCOL_STREAM_CHANNEL_FACTORY_H_ 6 #define REMOTING_PROTOCOL_STREAM_CHANNEL_FACTORY_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
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 14
15 namespace remoting { 15 namespace remoting {
16 namespace protocol { 16 namespace protocol {
17 17
18 class P2PStreamSocket; 18 class P2PStreamSocket;
19 19
20 class StreamChannelFactory : public base::NonThreadSafe { 20 class StreamChannelFactory {
21 public: 21 public:
22 // TODO(sergeyu): Specify connection error code when channel 22 // TODO(sergeyu): Specify connection error code when channel
23 // connection fails. 23 // connection fails.
24 typedef base::Callback<void(std::unique_ptr<P2PStreamSocket>)> 24 typedef base::Callback<void(std::unique_ptr<P2PStreamSocket>)>
25 ChannelCreatedCallback; 25 ChannelCreatedCallback;
26 26
27 StreamChannelFactory() {} 27 StreamChannelFactory() {}
28 28
29 // Creates new channels and calls the |callback| when then new channel is 29 // Creates new channels and calls the |callback| when then new channel is
30 // created and connected. The |callback| is called with nullptr if connection 30 // created and connected. The |callback| is called with nullptr if connection
31 // failed for any reason. Callback may be called synchronously, before the 31 // failed for any reason. Callback may be called synchronously, before the
32 // call returns. All channels must be destroyed, and CancelChannelCreation() 32 // call returns. All channels must be destroyed, and CancelChannelCreation()
33 // called for any pending channels, before the factory is destroyed. 33 // called for any pending channels, before the factory is destroyed.
34 virtual void CreateChannel(const std::string& name, 34 virtual void CreateChannel(const std::string& name,
35 const ChannelCreatedCallback& callback) = 0; 35 const ChannelCreatedCallback& callback) = 0;
36 36
37 // Cancels a pending CreateChannel() operation for the named channel. If the 37 // Cancels a pending CreateChannel() operation for the named channel. If the
38 // channel creation already completed then canceling it has no effect. When 38 // channel creation already completed then canceling it has no effect. When
39 // shutting down this method must be called for each channel pending creation. 39 // shutting down this method must be called for each channel pending creation.
40 virtual void CancelChannelCreation(const std::string& name) = 0; 40 virtual void CancelChannelCreation(const std::string& name) = 0;
41 41
42 protected: 42 protected:
43 virtual ~StreamChannelFactory() {} 43 virtual ~StreamChannelFactory() {}
44 44
45 SEQUENCE_CHECKER(sequence_checker_);
46
45 private: 47 private:
46 DISALLOW_COPY_AND_ASSIGN(StreamChannelFactory); 48 DISALLOW_COPY_AND_ASSIGN(StreamChannelFactory);
47 }; 49 };
48 50
49 } // namespace protocol 51 } // namespace protocol
50 } // namespace remoting 52 } // namespace remoting
51 53
52 #endif // REMOTING_PROTOCOL_STREAM_CHANNEL_FACTORY_H_ 54 #endif // REMOTING_PROTOCOL_STREAM_CHANNEL_FACTORY_H_
OLDNEW
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator.cc ('k') | remoting/signaling/fake_signal_strategy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698