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

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

Issue 7218061: Close all writers before JingleSession is destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 5 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/message_loop.h" 13 #include "base/message_loop.h"
14 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
15 #include "remoting/protocol/session.h" 15 #include "remoting/protocol/session.h"
16 #include "remoting/protocol/video_writer.h" 16 #include "remoting/protocol/video_writer.h"
17 17
18 namespace remoting { 18 namespace remoting {
19 namespace protocol { 19 namespace protocol {
20 20
21 class ClientControlSender;
21 class ClientStub; 22 class ClientStub;
22 class HostStub; 23 class HostStub;
23 class InputStub; 24 class InputStub;
24 class HostMessageDispatcher; 25 class HostMessageDispatcher;
25 26
26 // This class represents a remote viewer connected to the chromoting host 27 // This class represents a remote viewer connected to the chromoting host
27 // through a libjingle connection. A viewer object is responsible for sending 28 // through a libjingle connection. A viewer object is responsible for sending
28 // screen updates and other messages to the remote viewer. It is also 29 // screen updates and other messages to the remote viewer. It is also
29 // responsible for receiving and parsing data from the remote viewer and 30 // responsible for receiving and parsing data from the remote viewer and
30 // delegating events to the event handler. 31 // delegating events to the event handler.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 virtual void set_input_stub(InputStub* input_stub); 83 virtual void set_input_stub(InputStub* input_stub);
83 84
84 protected: 85 protected:
85 friend class base::RefCountedThreadSafe<ConnectionToClient>; 86 friend class base::RefCountedThreadSafe<ConnectionToClient>;
86 virtual ~ConnectionToClient(); 87 virtual ~ConnectionToClient();
87 88
88 private: 89 private:
89 // Callback for protocol Session. 90 // Callback for protocol Session.
90 void OnSessionStateChange(Session::State state); 91 void OnSessionStateChange(Session::State state);
91 92
92 // Process a libjingle state change event on the |loop_|.
93 void StateChangeTask(Session::State state);
94
95 void OnClosed(); 93 void OnClosed();
96 94
97 // The libjingle channel used to send and receive data from the remote client. 95 // The libjingle channel used to send and receive data from the remote client.
98 scoped_refptr<Session> session_; 96 scoped_refptr<Session> session_;
99 97
100 scoped_ptr<VideoWriter> video_writer_; 98 scoped_ptr<VideoWriter> video_writer_;
101 99
102 // ClientStub for sending messages to the client. 100 // ClientStub for sending messages to the client.
103 scoped_ptr<ClientStub> client_stub_; 101 scoped_ptr<ClientControlSender> client_control_sender_;
104 102
105 // The message loop that this object runs on. 103 // The message loop that this object runs on.
106 MessageLoop* loop_; 104 MessageLoop* loop_;
107 105
108 // Event handler for handling events sent from this object. 106 // Event handler for handling events sent from this object.
109 EventHandler* handler_; 107 EventHandler* handler_;
110 108
111 // HostStub for receiving control events from the client. 109 // HostStub for receiving control events from the client.
112 HostStub* host_stub_; 110 HostStub* host_stub_;
113 111
114 // InputStub for receiving input events from the client. 112 // InputStub for receiving input events from the client.
115 InputStub* input_stub_; 113 InputStub* input_stub_;
116 114
117 // Dispatcher for submitting messages to stubs. 115 // Dispatcher for submitting messages to stubs.
118 scoped_ptr<HostMessageDispatcher> dispatcher_; 116 scoped_ptr<HostMessageDispatcher> dispatcher_;
119 117
120 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient); 118 DISALLOW_COPY_AND_ASSIGN(ConnectionToClient);
121 }; 119 };
122 120
123 } // namespace protocol 121 } // namespace protocol
124 } // namespace remoting 122 } // namespace remoting
125 123
126 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_ 124 #endif // REMOTING_PROTOCOL_CONNECTION_TO_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698