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

Unified Diff: remoting/host/chromoting_host.cc

Issue 8495035: Make ConnectionToClient and ClientSession not ref-counted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 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/chromoting_host_unittest.cc » ('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 e23102b03791f4342eb1b0ee403842800370440e..c6485779d4b0a86aad1e02217653900f07e8b837 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -64,6 +64,7 @@ ChromotingHost::ChromotingHost(ChromotingHostContext* context,
}
ChromotingHost::~ChromotingHost() {
+ DCHECK(clients_.empty());
}
void ChromotingHost::Start() {
@@ -210,7 +211,7 @@ void ChromotingHost::OnSessionAuthenticated(ClientSession* client) {
void ChromotingHost::OnSessionClosed(ClientSession* client) {
DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
- scoped_refptr<ClientSession> client_ref = client;
+ scoped_ptr<ClientSession> client_destroyer(client);
ClientList::iterator it = std::find(clients_.begin(), clients_.end(), client);
CHECK(it != clients_.end());
@@ -353,9 +354,8 @@ void ChromotingHost::OnIncomingSession(
LOG(INFO) << "Client connected: " << session->jid();
// Create a client object.
- scoped_refptr<protocol::ConnectionToClient> connection =
- new protocol::ConnectionToClient(context_->network_message_loop(),
- session);
+ protocol::ConnectionToClient* connection =
+ new protocol::ConnectionToClient(session);
ClientSession* client = new ClientSession(
this, connection, desktop_environment_->event_executor(),
desktop_environment_->capturer());
@@ -378,7 +378,7 @@ void ChromotingHost::LocalMouseMoved(const SkIPoint& new_pos) {
ClientList::iterator client;
for (client = clients_.begin(); client != clients_.end(); ++client) {
- client->get()->LocalMouseMoved(new_pos);
+ (*client)->LocalMouseMoved(new_pos);
}
}
@@ -391,7 +391,7 @@ void ChromotingHost::PauseSession(bool pause) {
ClientList::iterator client;
for (client = clients_.begin(); client != clients_.end(); ++client) {
- client->get()->set_awaiting_continue_approval(pause);
+ (*client)->set_awaiting_continue_approval(pause);
}
desktop_environment_->OnPause(pause);
}
@@ -430,7 +430,7 @@ int ChromotingHost::AuthenticatedClientsCount() const {
int authenticated_clients = 0;
for (ClientList::const_iterator it = clients_.begin(); it != clients_.end();
++it) {
- if (it->get()->authenticated())
+ if ((*it)->authenticated())
++authenticated_clients;
}
return authenticated_clients;
« no previous file with comments | « remoting/host/chromoting_host.h ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698