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

Unified Diff: remoting/host/chromoting_host.cc

Issue 4313001: Rename classes for Chromoting: (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Resolve merge conflicts 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/client_connection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index d77e23c6e80ddcc1270b86ae2087ade254b1bf7d..4a75d52c5516059df7b94afdf416523dfe3f7199 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -17,8 +17,8 @@
#include "remoting/host/event_executor.h"
#include "remoting/host/host_config.h"
#include "remoting/host/session_manager.h"
-#include "remoting/protocol/jingle_chromotocol_server.h"
#include "remoting/protocol/chromotocol_config.h"
+#include "remoting/protocol/jingle_session_manager.h"
namespace remoting {
@@ -116,9 +116,9 @@ void ChromotingHost::Shutdown() {
heartbeat_sender_->Stop();
}
- // Stop chromotocol server.
- if (chromotocol_server_) {
- chromotocol_server_->Close(
+ // Stop chromotocol session manager.
+ if (session_manager_) {
+ session_manager_->Close(
NewRunnableMethod(this, &ChromotingHost::OnServerClosed));
}
@@ -143,7 +143,7 @@ void ChromotingHost::OnClientConnected(ClientConnection* client) {
// it should run on.
DCHECK(capturer_.get());
- Encoder* encoder = CreateEncoder(client->connection()->config());
+ Encoder* encoder = CreateEncoder(client->session()->config());
session_ = new SessionManager(context_->capture_message_loop(),
context_->encode_message_loop(),
@@ -217,15 +217,15 @@ void ChromotingHost::OnStateChange(JingleClient* jingle_client,
DCHECK_EQ(jingle_client_.get(), jingle_client);
VLOG(1) << "Host connected as " << jingle_client->GetFullJid();
- // Create and start |chromotocol_server_|.
- JingleChromotocolServer* server =
- new JingleChromotocolServer(context_->jingle_thread());
+ // Create and start session manager.
+ protocol::JingleSessionManager* server =
+ new protocol::JingleSessionManager(context_->jingle_thread());
// TODO(ajwong): Make this a command switch when we're more stable.
server->set_allow_local_ips(true);
server->Init(jingle_client->GetFullJid(),
jingle_client->session_manager(),
- NewCallback(this, &ChromotingHost::OnNewClientConnection));
- chromotocol_server_ = server;
+ NewCallback(this, &ChromotingHost::OnNewClientSession));
+ session_manager_ = server;
// Start heartbeating.
heartbeat_sender_->Start();
@@ -241,19 +241,19 @@ void ChromotingHost::OnStateChange(JingleClient* jingle_client,
}
}
-void ChromotingHost::OnNewClientConnection(
- ChromotocolConnection* connection,
- ChromotocolServer::IncomingConnectionResponse* response) {
+void ChromotingHost::OnNewClientSession(
+ protocol::Session* session,
+ protocol::SessionManager::IncomingSessionResponse* response) {
AutoLock auto_lock(lock_);
// TODO(hclam): Allow multiple clients to connect to the host.
if (client_.get() || state_ != kStarted) {
- *response = ChromotocolServer::DECLINE;
+ *response = protocol::SessionManager::DECLINE;
return;
}
// Check that the user has access to the host.
- if (!access_verifier_.VerifyPermissions(connection->jid())) {
- *response = ChromotocolServer::DECLINE;
+ if (!access_verifier_.VerifyPermissions(session->jid())) {
+ *response = protocol::SessionManager::DECLINE;
return;
}
@@ -263,26 +263,26 @@ void ChromotingHost::OnNewClientConnection(
ScreenResolution(capturer_->width(), capturer_->height()));
// TODO(sergeyu): Respect resolution requested by the client if supported.
ChromotocolConfig* config =
- local_config->Select(connection->candidate_config(),
+ local_config->Select(session->candidate_config(),
true /* force_host_resolution */);
if (!config) {
- LOG(WARNING) << "Rejecting connection from " << connection->jid()
- << " because no compartible configuration has been found.";
- *response = ChromotocolServer::INCOMPATIBLE;
+ LOG(WARNING) << "Rejecting connection from " << session->jid()
+ << " because no compatible configuration has been found.";
+ *response = protocol::SessionManager::INCOMPATIBLE;
return;
}
- connection->set_config(config);
+ session->set_config(config);
- *response = ChromotocolServer::ACCEPT;
+ *response = protocol::SessionManager::ACCEPT;
- VLOG(1) << "Client connected: " << connection->jid();
+ VLOG(1) << "Client connected: " << session->jid();
// If we accept the connected then create a client object and set the
// callback.
client_ = new ClientConnection(context_->main_message_loop(), this);
- client_->Init(connection);
+ client_->Init(session);
}
void ChromotingHost::OnServerClosed() {
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/client_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698