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

Side by Side Diff: remoting/host/client_session.h

Issue 9316052: Log IP/port of host as well as client in Me2Me host (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 | Annotate | Revision Log
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_HOST_CLIENT_SESSION_H_ 5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_
6 #define REMOTING_HOST_CLIENT_SESSION_H_ 6 #define REMOTING_HOST_CLIENT_SESSION_H_
7 7
8 #include <list> 8 #include <list>
9 #include <set> 9 #include <set>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Called after connection has failed or after the client closed it. 42 // Called after connection has failed or after the client closed it.
43 virtual void OnSessionClosed(ClientSession* client) = 0; 43 virtual void OnSessionClosed(ClientSession* client) = 0;
44 44
45 // Called to notify of each message's sequence number. The 45 // Called to notify of each message's sequence number. The
46 // callback must not tear down this object. 46 // callback must not tear down this object.
47 virtual void OnSessionSequenceNumber(ClientSession* client, 47 virtual void OnSessionSequenceNumber(ClientSession* client,
48 int64 sequence_number) = 0; 48 int64 sequence_number) = 0;
49 49
50 // Called on notification of a route change event, when a channel is 50 // Called on notification of a route change event, when a channel is
51 // connected. 51 // connected.
52 virtual void OnSessionIpAddress(ClientSession* client, 52 virtual void OnSessionIpAddress(ClientSession* client,
Sergey Ulanov 2012/02/02 01:10:23 Rename to OnSessionRouteChange?
Lambros 2012/02/02 01:48:12 Done.
53 const std::string& channel_name, 53 const std::string& channel_name,
54 const net::IPEndPoint& end_point) = 0; 54 const net::IPEndPoint& end_point,
55 const net::IPEndPoint& local_end_point) = 0;
55 }; 56 };
56 57
57 // Takes ownership of |connection|. Does not take ownership of 58 // Takes ownership of |connection|. Does not take ownership of
58 // |event_handler|, |input_stub| or |capturer|. 59 // |event_handler|, |input_stub| or |capturer|.
59 ClientSession(EventHandler* event_handler, 60 ClientSession(EventHandler* event_handler,
60 protocol::ConnectionToClient* connection, 61 protocol::ConnectionToClient* connection,
61 protocol::InputStub* input_stub, 62 protocol::InputStub* input_stub,
62 Capturer* capturer); 63 Capturer* capturer);
63 virtual ~ClientSession(); 64 virtual ~ClientSession();
64 65
65 // protocol::InputStub interface. 66 // protocol::InputStub interface.
66 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; 67 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
67 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; 68 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
68 69
69 // protocol::ConnectionToClient::EventHandler interface. 70 // protocol::ConnectionToClient::EventHandler interface.
70 virtual void OnConnectionOpened( 71 virtual void OnConnectionOpened(
71 protocol::ConnectionToClient* connection) OVERRIDE; 72 protocol::ConnectionToClient* connection) OVERRIDE;
72 virtual void OnConnectionClosed( 73 virtual void OnConnectionClosed(
73 protocol::ConnectionToClient* connection) OVERRIDE; 74 protocol::ConnectionToClient* connection) OVERRIDE;
74 virtual void OnConnectionFailed(protocol::ConnectionToClient* connection, 75 virtual void OnConnectionFailed(protocol::ConnectionToClient* connection,
75 protocol::Session::Error error) OVERRIDE; 76 protocol::Session::Error error) OVERRIDE;
76 virtual void OnSequenceNumberUpdated( 77 virtual void OnSequenceNumberUpdated(
77 protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE; 78 protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE;
78 virtual void OnClientIpAddress(protocol::ConnectionToClient* connection, 79 virtual void OnClientIpAddress(
79 const std::string& channel_name, 80 protocol::ConnectionToClient* connection,
80 const net::IPEndPoint& end_point) OVERRIDE; 81 const std::string& channel_name,
82 const net::IPEndPoint& end_point,
83 const net::IPEndPoint& local_end_point) OVERRIDE;
81 84
82 // Disconnects the session and destroys the transport. Event handler 85 // Disconnects the session and destroys the transport. Event handler
83 // is guaranteed not to be called after this method is called. Can 86 // is guaranteed not to be called after this method is called. Can
84 // be called multiple times. The object should not be used after 87 // be called multiple times. The object should not be used after
85 // this method returns. 88 // this method returns.
86 void Disconnect(); 89 void Disconnect();
87 90
88 protocol::ConnectionToClient* connection() const { 91 protocol::ConnectionToClient* connection() const {
89 return connection_.get(); 92 return connection_.get();
90 } 93 }
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // Set of keys that are currently pressed down by the user. This is used so 162 // Set of keys that are currently pressed down by the user. This is used so
160 // we can release them if the user disconnects. 163 // we can release them if the user disconnects.
161 std::set<int> pressed_keys_; 164 std::set<int> pressed_keys_;
162 165
163 DISALLOW_COPY_AND_ASSIGN(ClientSession); 166 DISALLOW_COPY_AND_ASSIGN(ClientSession);
164 }; 167 };
165 168
166 } // namespace remoting 169 } // namespace remoting
167 170
168 #endif // REMOTING_HOST_CLIENT_SESSION_H_ 171 #endif // REMOTING_HOST_CLIENT_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698