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

Unified Diff: remoting/host/chromoting_host_unittest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/host/client_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host_unittest.cc
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index a797e4be2efda4020d58475634d8af500c4de760..2ff5b03f0ec0c44dd74243b047cbe9250978bfab 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -104,8 +104,10 @@ class ChromotingHostTest : public testing::Test {
local_input_monitor_ = new MockLocalInputMonitor();
it2me_host_user_interface_.reset(new It2MeHostUserInterface(host_,
&context_));
- it2me_host_user_interface_->InitFrom(disconnect_window_, continue_window_,
- local_input_monitor_);
+ it2me_host_user_interface_->InitFrom(
+ scoped_ptr<DisconnectWindow>(disconnect_window_),
+ scoped_ptr<ContinueWindow>(continue_window_),
+ scoped_ptr<LocalInputMonitor>(local_input_monitor_));
session_ = new MockSession();
session2_ = new MockSession();
@@ -178,10 +180,12 @@ class ChromotingHostTest : public testing::Test {
// Helper method to pretend a client is connected to ChromotingHost.
void SimulateClientConnection(int connection_index, bool authenticate) {
- protocol::ConnectionToClient* connection = (connection_index == 0) ?
- owned_connection_.release() : owned_connection2_.release();
+ scoped_ptr<protocol::ConnectionToClient> connection =
+ ((connection_index == 0) ? owned_connection_ : owned_connection2_).
+ PassAs<protocol::ConnectionToClient>();
+ protocol::ConnectionToClient* connection_ptr = connection.get();
ClientSession* client = new ClientSession(
- host_.get(), connection, event_executor_,
+ host_.get(), connection.Pass(), event_executor_,
desktop_environment_->capturer());
connection->set_host_stub(client);
@@ -191,7 +195,7 @@ class ChromotingHostTest : public testing::Test {
if (authenticate) {
context_.network_message_loop()->PostTask(
FROM_HERE, base::Bind(&ClientSession::OnConnectionOpened,
- base::Unretained(client), connection));
+ base::Unretained(client), connection_ptr));
}
if (connection_index == 0) {
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/host/client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698