| 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 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 message_loop_(message_loop), | 45 message_loop_(message_loop), |
| 46 session_(NULL), | 46 session_(NULL), |
| 47 ALLOW_THIS_IN_INITIALIZER_LIST( | 47 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 48 write_cb_(this, &ProtocolTestConnection::OnWritten)), | 48 write_cb_(this, &ProtocolTestConnection::OnWritten)), |
| 49 pending_write_(false), | 49 pending_write_(false), |
| 50 ALLOW_THIS_IN_INITIALIZER_LIST( | 50 ALLOW_THIS_IN_INITIALIZER_LIST( |
| 51 read_cb_(this, &ProtocolTestConnection::OnRead)), | 51 read_cb_(this, &ProtocolTestConnection::OnRead)), |
| 52 closed_event_(true, false) { | 52 closed_event_(true, false) { |
| 53 } | 53 } |
| 54 | 54 |
| 55 virtual ~ProtocolTestConnection() {} |
| 56 |
| 55 void Init(Session* session); | 57 void Init(Session* session); |
| 56 void Write(const std::string& str); | 58 void Write(const std::string& str); |
| 57 void Read(); | 59 void Read(); |
| 58 void Close(); | 60 void Close(); |
| 59 | 61 |
| 60 // Session::Callback interface. | 62 // Session::Callback interface. |
| 61 virtual void OnStateChange(Session::State state); | 63 virtual void OnStateChange(Session::State state); |
| 62 private: | 64 private: |
| 63 void DoWrite(scoped_refptr<net::IOBuffer> buf, int size); | 65 void DoWrite(scoped_refptr<net::IOBuffer> buf, int size); |
| 64 void DoRead(); | 66 void DoRead(); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 std::string auth_service("oauth2"); | 379 std::string auth_service("oauth2"); |
| 378 if (cmd_line->HasSwitch("auth_service")) | 380 if (cmd_line->HasSwitch("auth_service")) |
| 379 auth_service = cmd_line->GetSwitchValueASCII("auth_service"); | 381 auth_service = cmd_line->GetSwitchValueASCII("auth_service"); |
| 380 | 382 |
| 381 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); | 383 scoped_refptr<ProtocolTestClient> client(new ProtocolTestClient()); |
| 382 | 384 |
| 383 client->Run(username, auth_token, host_jid, auth_service); | 385 client->Run(username, auth_token, host_jid, auth_service); |
| 384 | 386 |
| 385 return 0; | 387 return 0; |
| 386 } | 388 } |
| OLD | NEW |