OLD | NEW |
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 } |
11 #endif // !defined(OS_WIN) | 11 #endif // !defined(OS_WIN) |
12 | 12 |
13 #include <iostream> | 13 #include <iostream> |
14 #include <list> | 14 #include <list> |
15 | 15 |
16 #include "base/at_exit.h" | 16 #include "base/at_exit.h" |
17 #include "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "base/message_loop_proxy.h" |
19 #include "base/test/mock_chrome_application_mac.h" | 20 #include "base/test/mock_chrome_application_mac.h" |
20 #include "base/time.h" | 21 #include "base/time.h" |
21 #include "crypto/nss_util.h" | 22 #include "crypto/nss_util.h" |
22 #include "net/base/completion_callback.h" | 23 #include "net/base/completion_callback.h" |
23 #include "net/base/io_buffer.h" | 24 #include "net/base/io_buffer.h" |
24 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
25 #include "net/socket/socket.h" | 26 #include "net/socket/socket.h" |
26 #include "remoting/base/constants.h" | 27 #include "remoting/base/constants.h" |
27 #include "remoting/jingle_glue/jingle_thread.h" | 28 #include "remoting/jingle_glue/jingle_thread.h" |
28 #include "remoting/jingle_glue/xmpp_signal_strategy.h" | 29 #include "remoting/jingle_glue/xmpp_signal_strategy.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 const std::string& auth_token, | 216 const std::string& auth_token, |
216 const std::string& auth_service, | 217 const std::string& auth_service, |
217 const std::string& host_jid) { | 218 const std::string& host_jid) { |
218 remoting::JingleThread jingle_thread; | 219 remoting::JingleThread jingle_thread; |
219 jingle_thread.Start(); | 220 jingle_thread.Start(); |
220 | 221 |
221 signal_strategy_.reset( | 222 signal_strategy_.reset( |
222 new XmppSignalStrategy(&jingle_thread, username, auth_token, | 223 new XmppSignalStrategy(&jingle_thread, username, auth_token, |
223 auth_service)); | 224 auth_service)); |
224 signal_strategy_->Init(this); | 225 signal_strategy_->Init(this); |
225 session_manager_.reset(JingleSessionManager::CreateNotSandboxed()); | 226 session_manager_.reset(JingleSessionManager::CreateNotSandboxed( |
| 227 jingle_thread.message_loop_proxy())); |
226 | 228 |
227 host_jid_ = host_jid; | 229 host_jid_ = host_jid; |
228 | 230 |
229 while (true) { | 231 while (true) { |
230 std::string line; | 232 std::string line; |
231 std::getline(std::cin, line); | 233 std::getline(std::cin, line); |
232 | 234 |
233 { | 235 { |
234 base::AutoLock auto_lock(connections_lock_); | 236 base::AutoLock auto_lock(connections_lock_); |
235 | 237 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 std::string auth_service("oauth2"); | 359 std::string auth_service("oauth2"); |
358 if (cmd_line->HasSwitch("auth_service")) | 360 if (cmd_line->HasSwitch("auth_service")) |
359 auth_service = cmd_line->GetSwitchValueASCII("auth_service"); | 361 auth_service = cmd_line->GetSwitchValueASCII("auth_service"); |
360 | 362 |
361 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); | 363 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); |
362 | 364 |
363 client->Run(username, auth_token, host_jid, auth_service); | 365 client->Run(username, auth_token, host_jid, auth_service); |
364 | 366 |
365 return 0; | 367 return 0; |
366 } | 368 } |
OLD | NEW |