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

Side by Side Diff: remoting/protocol/channel_dispatcher_base.h

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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_CHANNEL_DISPATCHER_BASE_H_ 5 #ifndef REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
6 #define REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_ 6 #define REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 23 matching lines...) Expand all
34 34
35 virtual ~ChannelDispatcherBase(); 35 virtual ~ChannelDispatcherBase();
36 36
37 // Creates and connects the channel in the specified 37 // Creates and connects the channel in the specified
38 // |session|. Caller retains ownership of the Session. 38 // |session|. Caller retains ownership of the Session.
39 void Init(Session* session, 39 void Init(Session* session,
40 const ChannelConfig& config, 40 const ChannelConfig& config,
41 const InitializedCallback& callback); 41 const InitializedCallback& callback);
42 42
43 // Returns true if the channel is currently connected. 43 // Returns true if the channel is currently connected.
44 bool is_connected() { return channel() != NULL; } 44 bool is_connected() { return channel() != nullptr; }
45 45
46 protected: 46 protected:
47 explicit ChannelDispatcherBase(const char* channel_name); 47 explicit ChannelDispatcherBase(const char* channel_name);
48 48
49 net::StreamSocket* channel() { return channel_.get(); } 49 net::StreamSocket* channel() { return channel_.get(); }
50 50
51 // Called when channel is initialized. Must be overriden in the 51 // Called when channel is initialized. Must be overriden in the
52 // child classes. Should not delete the dispatcher. 52 // child classes. Should not delete the dispatcher.
53 virtual void OnInitialized() = 0; 53 virtual void OnInitialized() = 0;
54 54
55 private: 55 private:
56 void OnChannelReady(scoped_ptr<net::StreamSocket> socket); 56 void OnChannelReady(scoped_ptr<net::StreamSocket> socket);
57 57
58 std::string channel_name_; 58 std::string channel_name_;
59 StreamChannelFactory* channel_factory_; 59 StreamChannelFactory* channel_factory_;
60 InitializedCallback initialized_callback_; 60 InitializedCallback initialized_callback_;
61 scoped_ptr<net::StreamSocket> channel_; 61 scoped_ptr<net::StreamSocket> channel_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(ChannelDispatcherBase); 63 DISALLOW_COPY_AND_ASSIGN(ChannelDispatcherBase);
64 }; 64 };
65 65
66 } // namespace protocol 66 } // namespace protocol
67 } // namespace remoting 67 } // namespace remoting
68 68
69 #endif // REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_ 69 #endif // REMOTING_PROTOCOL_CHANNEL_DISPATCHER_BASE_H_
OLDNEW
« no previous file with comments | « remoting/protocol/buffered_socket_writer.cc ('k') | remoting/protocol/channel_dispatcher_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698