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

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

Issue 5298001: Use VP8 over PseudoTCP by default. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated service_process.cc Created 10 years, 1 month 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_CHROMOTING_HOST_H_ 5 #ifndef REMOTING_CHROMOTING_HOST_H_
6 #define REMOTING_CHROMOTING_HOST_H_ 6 #define REMOTING_CHROMOTING_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/thread.h" 10 #include "base/thread.h"
11 #include "remoting/base/encoder.h" 11 #include "remoting/base/encoder.h"
12 #include "remoting/host/access_verifier.h" 12 #include "remoting/host/access_verifier.h"
13 #include "remoting/host/capturer.h" 13 #include "remoting/host/capturer.h"
14 #include "remoting/host/heartbeat_sender.h" 14 #include "remoting/host/heartbeat_sender.h"
15 #include "remoting/jingle_glue/jingle_client.h" 15 #include "remoting/jingle_glue/jingle_client.h"
16 #include "remoting/jingle_glue/jingle_thread.h" 16 #include "remoting/jingle_glue/jingle_thread.h"
17 #include "remoting/protocol/session_manager.h" 17 #include "remoting/protocol/session_manager.h"
18 #include "remoting/protocol/connection_to_client.h" 18 #include "remoting/protocol/connection_to_client.h"
19 19
20 class Task; 20 class Task;
21 21
22 namespace remoting { 22 namespace remoting {
23 23
24 namespace protocol { 24 namespace protocol {
25 class ConnectionToClient; 25 class ConnectionToClient;
26 class HostStub; 26 class HostStub;
27 class InputStub; 27 class InputStub;
28 class SessionConfig; 28 class SessionConfig;
29 class CandidateSessionConfig;
29 } // namespace protocol 30 } // namespace protocol
30 31
31 class Capturer; 32 class Capturer;
32 class ChromotingHostContext; 33 class ChromotingHostContext;
33 class Encoder; 34 class Encoder;
34 class MutableHostConfig; 35 class MutableHostConfig;
35 class SessionManager; 36 class SessionManager;
36 37
37 // A class to implement the functionality of a host process. 38 // A class to implement the functionality of a host process.
38 // 39 //
(...skipping 22 matching lines...) Expand all
61 // incoming connection. 62 // incoming connection.
62 class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, 63 class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>,
63 public protocol::ConnectionToClient::EventHandler, 64 public protocol::ConnectionToClient::EventHandler,
64 public JingleClient::Callback { 65 public JingleClient::Callback {
65 public: 66 public:
66 ChromotingHost(ChromotingHostContext* context, MutableHostConfig* config); 67 ChromotingHost(ChromotingHostContext* context, MutableHostConfig* config);
67 ChromotingHost(ChromotingHostContext* context, MutableHostConfig* config, 68 ChromotingHost(ChromotingHostContext* context, MutableHostConfig* config,
68 Capturer* capturer); 69 Capturer* capturer);
69 virtual ~ChromotingHost(); 70 virtual ~ChromotingHost();
70 71
72 static ChromotingHost* Create(ChromotingHostContext* context,
73 MutableHostConfig* config);
74 static ChromotingHost* Create(ChromotingHostContext* context,
75 MutableHostConfig* config,
76 Capturer* capturer);
77
71 // Asynchronously start the host process. 78 // Asynchronously start the host process.
72 // 79 //
73 // After this is invoked, the host process will connect to the talk 80 // After this is invoked, the host process will connect to the talk
74 // network and start listening for incoming connections. 81 // network and start listening for incoming connections.
75 // 82 //
76 // |shutdown_task| is called if Start() has failed ot Shutdown() is called 83 // |shutdown_task| is called if Start() has failed ot Shutdown() is called
77 // and all related operations are completed. 84 // and all related operations are completed.
78 // 85 //
79 // This method can only be called once during the lifetime of this object. 86 // This method can only be called once during the lifetime of this object.
80 void Start(Task* shutdown_task); 87 void Start(Task* shutdown_task);
(...skipping 15 matching lines...) Expand all
96 103
97 //////////////////////////////////////////////////////////////////////////// 104 ////////////////////////////////////////////////////////////////////////////
98 // JingleClient::Callback implementations 105 // JingleClient::Callback implementations
99 virtual void OnStateChange(JingleClient* client, JingleClient::State state); 106 virtual void OnStateChange(JingleClient* client, JingleClient::State state);
100 107
101 // Callback for ChromotingServer. 108 // Callback for ChromotingServer.
102 void OnNewClientSession( 109 void OnNewClientSession(
103 protocol::Session* session, 110 protocol::Session* session,
104 protocol::SessionManager::IncomingSessionResponse* response); 111 protocol::SessionManager::IncomingSessionResponse* response);
105 112
113 // Sets desired configuration for the protocol. Ownership of the
114 // |config| is transfered to the object. Must be called before Start().
115 void set_protocol_config(protocol::CandidateSessionConfig* config);
116
106 private: 117 private:
107 enum State { 118 enum State {
108 kInitial, 119 kInitial,
109 kStarted, 120 kStarted,
110 kStopped, 121 kStopped,
111 }; 122 };
112 123
113 // This method connects to the talk network and start listening for incoming
114 // connections.
115 void DoStart(Task* shutdown_task);
116
117 // Callback for protocol::SessionManager::Close(). 124 // Callback for protocol::SessionManager::Close().
118 void OnServerClosed(); 125 void OnServerClosed();
119 126
120 // Creates encoder for the specified configuration. 127 // Creates encoder for the specified configuration.
121 Encoder* CreateEncoder(const protocol::SessionConfig* config); 128 Encoder* CreateEncoder(const protocol::SessionConfig* config);
122 129
123 // The context that the chromoting host runs on. 130 // The context that the chromoting host runs on.
124 ChromotingHostContext* context_; 131 ChromotingHostContext* context_;
125 132
126 scoped_refptr<MutableHostConfig> config_; 133 scoped_refptr<MutableHostConfig> config_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 scoped_ptr<Task> shutdown_task_; 168 scoped_ptr<Task> shutdown_task_;
162 169
163 // Tracks the internal state of the host. 170 // Tracks the internal state of the host.
164 // This variable is written on the main thread of ChromotingHostContext 171 // This variable is written on the main thread of ChromotingHostContext
165 // and read by jingle thread. 172 // and read by jingle thread.
166 State state_; 173 State state_;
167 174
168 // Lock is to lock the access to |state_|. 175 // Lock is to lock the access to |state_|.
169 Lock lock_; 176 Lock lock_;
170 177
178 // Configuration of the protocol.
179 scoped_ptr<protocol::CandidateSessionConfig> protocol_config_;
180
171 DISALLOW_COPY_AND_ASSIGN(ChromotingHost); 181 DISALLOW_COPY_AND_ASSIGN(ChromotingHost);
172 }; 182 };
173 183
174 } // namespace remoting 184 } // namespace remoting
175 185
176 #endif // REMOTING_HOST_CHROMOTING_HOST_H_ 186 #endif // REMOTING_HOST_CHROMOTING_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698