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

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

Issue 9720019: Use scoped_ptr<> to pass ownership in more places. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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/base/encoder_vp8_unittest.cc ('k') | remoting/host/chromoting_host_unittest.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) 2012 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 #include "remoting/host/chromoting_host.h" 5 #include "remoting/host/chromoting_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 return; 254 return;
255 } 255 }
256 256
257 session->set_config(config); 257 session->set_config(config);
258 258
259 *response = protocol::SessionManager::ACCEPT; 259 *response = protocol::SessionManager::ACCEPT;
260 260
261 LOG(INFO) << "Client connected: " << session->jid(); 261 LOG(INFO) << "Client connected: " << session->jid();
262 262
263 // Create a client object. 263 // Create a client object.
264 protocol::ConnectionToClient* connection = 264 scoped_ptr<protocol::ConnectionToClient> connection(
265 new protocol::ConnectionToClient(session); 265 new protocol::ConnectionToClient(session));
266 ClientSession* client = new ClientSession( 266 ClientSession* client = new ClientSession(
267 this, connection, desktop_environment_->event_executor(), 267 this, connection.Pass(), desktop_environment_->event_executor(),
268 desktop_environment_->capturer()); 268 desktop_environment_->capturer());
269 clients_.push_back(client); 269 clients_.push_back(client);
270 } 270 }
271 271
272 void ChromotingHost::set_protocol_config( 272 void ChromotingHost::set_protocol_config(
273 protocol::CandidateSessionConfig* config) { 273 protocol::CandidateSessionConfig* config) {
274 DCHECK(context_->network_message_loop()->BelongsToCurrentThread()); 274 DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
275 DCHECK(config); 275 DCHECK(config);
276 DCHECK_EQ(state_, kInitial); 276 DCHECK_EQ(state_, kInitial);
277 protocol_config_.reset(config); 277 protocol_config_.reset(config);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 OnShutdown()); 365 OnShutdown());
366 366
367 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin(); 367 for (std::vector<base::Closure>::iterator it = shutdown_tasks_.begin();
368 it != shutdown_tasks_.end(); ++it) { 368 it != shutdown_tasks_.end(); ++it) {
369 it->Run(); 369 it->Run();
370 } 370 }
371 shutdown_tasks_.clear(); 371 shutdown_tasks_.clear();
372 } 372 }
373 373
374 } // namespace remoting 374 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/encoder_vp8_unittest.cc ('k') | remoting/host/chromoting_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698