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

Side by Side Diff: remoting/protocol/protocol_test_client.cc

Issue 7796026: Pass SessionConfig by reference instead of pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 3 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/protocol/protocol_mock_objects.h ('k') | remoting/protocol/session.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if !defined(OS_WIN) 7 #if !defined(OS_WIN)
8 extern "C" { 8 extern "C" {
9 #include <unistd.h> 9 #include <unistd.h>
10 } 10 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 NewCallback(connection, &ProtocolTestConnection::OnStateChange))); 299 NewCallback(connection, &ProtocolTestConnection::OnStateChange)));
300 connections_.push_back(make_scoped_refptr(connection)); 300 connections_.push_back(make_scoped_refptr(connection));
301 } 301 }
302 } 302 }
303 303
304 void ProtocolTestClient::OnIncomingSession( 304 void ProtocolTestClient::OnIncomingSession(
305 Session* session, 305 Session* session,
306 SessionManager::IncomingSessionResponse* response) { 306 SessionManager::IncomingSessionResponse* response) {
307 std::cerr << "Accepting connection from " << session->jid() << std::endl; 307 std::cerr << "Accepting connection from " << session->jid() << std::endl;
308 308
309 session->set_config(SessionConfig::CreateDefault()); 309 session->set_config(SessionConfig::GetDefault());
310 *response = SessionManager::ACCEPT; 310 *response = SessionManager::ACCEPT;
311 311
312 ProtocolTestConnection* test_connection = new ProtocolTestConnection(this); 312 ProtocolTestConnection* test_connection = new ProtocolTestConnection(this);
313 session->SetStateChangeCallback( 313 session->SetStateChangeCallback(
314 NewCallback(test_connection, &ProtocolTestConnection::OnStateChange)); 314 NewCallback(test_connection, &ProtocolTestConnection::OnStateChange));
315 test_connection->Init(session); 315 test_connection->Init(session);
316 base::AutoLock auto_lock(connections_lock_); 316 base::AutoLock auto_lock(connections_lock_);
317 connections_.push_back(make_scoped_refptr(test_connection)); 317 connections_.push_back(make_scoped_refptr(test_connection));
318 } 318 }
319 319
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 std::string auth_service("oauth2"); 359 std::string auth_service("oauth2");
360 if (cmd_line->HasSwitch("auth_service")) 360 if (cmd_line->HasSwitch("auth_service"))
361 auth_service = cmd_line->GetSwitchValueASCII("auth_service"); 361 auth_service = cmd_line->GetSwitchValueASCII("auth_service");
362 362
363 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); 363 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient());
364 364
365 client->Run(username, auth_token, host_jid, auth_service); 365 client->Run(username, auth_token, host_jid, auth_service);
366 366
367 return 0; 367 return 0;
368 } 368 }
OLDNEW
« no previous file with comments | « remoting/protocol/protocol_mock_objects.h ('k') | remoting/protocol/session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698