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

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

Issue 9288010: More plumbing for logging connection IP addresses (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix license headers Created 8 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 | Annotate | Revision Log
« no previous file with comments | « remoting/host/host_mock_objects.cc ('k') | remoting/protocol/connection_to_client.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 (c) 2011 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_CONNECTION_TO_CLIENT_H_ 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 6 #define REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
7 7
8 #include <deque> 8 #include <deque>
9 #include <string>
9 #include <vector> 10 #include <vector>
10 11
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "base/synchronization/lock.h" 13 #include "base/synchronization/lock.h"
13 #include "base/threading/non_thread_safe.h" 14 #include "base/threading/non_thread_safe.h"
14 #include "remoting/protocol/session.h" 15 #include "remoting/protocol/session.h"
15 #include "remoting/protocol/video_writer.h" 16 #include "remoting/protocol/video_writer.h"
16 17
18 namespace net {
19 class IPEndPoint;
20 } // namespace net
21
17 namespace remoting { 22 namespace remoting {
18 namespace protocol { 23 namespace protocol {
19 24
20 class ClientStub; 25 class ClientStub;
21 class HostStub; 26 class HostStub;
22 class InputStub; 27 class InputStub;
23 class HostControlDispatcher; 28 class HostControlDispatcher;
24 class HostEventDispatcher; 29 class HostEventDispatcher;
25 30
26 // This class represents a remote viewer connection to the chromoting 31 // This class represents a remote viewer connection to the chromoting
(...skipping 11 matching lines...) Expand all
38 // Called when the network connection is closed. 43 // Called when the network connection is closed.
39 virtual void OnConnectionClosed(ConnectionToClient* connection) = 0; 44 virtual void OnConnectionClosed(ConnectionToClient* connection) = 0;
40 45
41 // Called when the network connection has failed. 46 // Called when the network connection has failed.
42 virtual void OnConnectionFailed(ConnectionToClient* connection, 47 virtual void OnConnectionFailed(ConnectionToClient* connection,
43 Session::Error error) = 0; 48 Session::Error error) = 0;
44 49
45 // Called when sequence number is updated. 50 // Called when sequence number is updated.
46 virtual void OnSequenceNumberUpdated(ConnectionToClient* connection, 51 virtual void OnSequenceNumberUpdated(ConnectionToClient* connection,
47 int64 sequence_number) = 0; 52 int64 sequence_number) = 0;
53
54 // Called on notification of a route change event, which happens when a
55 // channel is connected.
56 virtual void OnClientIpAddress(ConnectionToClient* connection,
57 const std::string& channel_name,
58 const net::IPEndPoint& end_point) = 0;
48 }; 59 };
49 60
50 // Constructs a ConnectionToClient object for the |session|. Takes 61 // Constructs a ConnectionToClient object for the |session|. Takes
51 // ownership of |session|. 62 // ownership of |session|.
52 explicit ConnectionToClient(Session* session); 63 explicit ConnectionToClient(Session* session);
53 virtual ~ConnectionToClient(); 64 virtual ~ConnectionToClient();
54 65
55 // Set |event_handler| for connection events. |event_handler| is 66 // Set |event_handler| for connection events. Must be called once when this
56 // guaranteed to be used only on the network thread. Must be called 67 // object is created.
57 // once when this object is created.
58 void SetEventHandler(EventHandler* event_handler); 68 void SetEventHandler(EventHandler* event_handler);
59 69
60 // Returns the connection in use. 70 // Returns the connection in use.
61 virtual Session* session(); 71 virtual Session* session();
62 72
63 // Disconnect the client connection. 73 // Disconnect the client connection.
64 virtual void Disconnect(); 74 virtual void Disconnect();
65 75
66 // Update the sequence number when received from the client. EventHandler 76 // Update the sequence number when received from the client. EventHandler
67 // will be called. 77 // will be called.
68 virtual void UpdateSequenceNumber(int64 sequence_number); 78 virtual void UpdateSequenceNumber(int64 sequence_number);
69 79
70 // Send encoded update stream data to the viewer. 80 // Send encoded update stream data to the viewer.
71 virtual VideoStub* video_stub(); 81 virtual VideoStub* video_stub();
72 82
73 // Return pointer to ClientStub. 83 // Return pointer to ClientStub.
74 virtual ClientStub* client_stub(); 84 virtual ClientStub* client_stub();
75 85
76 // These two setters should be called before Init(). 86 // These two setters should be called before Init().
77 virtual void set_host_stub(HostStub* host_stub); 87 virtual void set_host_stub(HostStub* host_stub);
78 virtual void set_input_stub(InputStub* input_stub); 88 virtual void set_input_stub(InputStub* input_stub);
79 89
80 private: 90 private:
81 // Callback for protocol Session. 91 // Callback for protocol Session.
82 void OnSessionStateChange(Session::State state); 92 void OnSessionStateChange(Session::State state);
83 93
94 void OnSessionRouteChange(const std::string& channel_name,
95 const net::IPEndPoint& end_point);
96
84 // Callback for channel initialization. 97 // Callback for channel initialization.
85 void OnChannelInitialized(bool successful); 98 void OnChannelInitialized(bool successful);
86 99
87 void NotifyIfChannelsReady(); 100 void NotifyIfChannelsReady();
88 101
89 void CloseOnError(); 102 void CloseOnError();
90 103
91 // Stops writing in the channels. 104 // Stops writing in the channels.
92 void CloseChannels(); 105 void CloseChannels();
93 106
(...skipping 11 matching lines...) Expand all
105 scoped_ptr<HostEventDispatcher> event_dispatcher_; 118 scoped_ptr<HostEventDispatcher> event_dispatcher_;
106 scoped_ptr<VideoWriter> video_writer_; 119 scoped_ptr<VideoWriter> video_writer_;
107 120
108 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); 121 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient);
109 }; 122 };
110 123
111 } // namespace protocol 124 } // namespace protocol
112 } // namespace remoting 125 } // namespace remoting
113 126
114 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 127 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
OLDNEW
« no previous file with comments | « remoting/host/host_mock_objects.cc ('k') | remoting/protocol/connection_to_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698