| OLD | NEW |
| 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 #ifndef REMOTING_PROTOCOL_CONNECTION_TESTER_H_ | 5 #ifndef REMOTING_PROTOCOL_CONNECTION_TESTER_H_ |
| 6 #define REMOTING_PROTOCOL_CONNECTION_TESTER_H_ | 6 #define REMOTING_PROTOCOL_CONNECTION_TESTER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 | 11 |
| 12 namespace base { |
| 12 class MessageLoop; | 13 class MessageLoop; |
| 14 } |
| 13 | 15 |
| 14 namespace net { | 16 namespace net { |
| 15 class DrainableIOBuffer; | 17 class DrainableIOBuffer; |
| 16 class GrowableIOBuffer; | 18 class GrowableIOBuffer; |
| 17 class IOBuffer; | 19 class IOBuffer; |
| 18 class Socket; | 20 class Socket; |
| 19 class StreamSocket; | 21 class StreamSocket; |
| 20 } // namespace net | 22 } // namespace net |
| 21 | 23 |
| 22 namespace remoting { | 24 namespace remoting { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 41 void Done(); | 43 void Done(); |
| 42 void InitBuffers(); | 44 void InitBuffers(); |
| 43 void DoWrite(); | 45 void DoWrite(); |
| 44 void OnWritten(int result); | 46 void OnWritten(int result); |
| 45 void HandleWriteResult(int result); | 47 void HandleWriteResult(int result); |
| 46 void DoRead(); | 48 void DoRead(); |
| 47 void OnRead(int result); | 49 void OnRead(int result); |
| 48 void HandleReadResult(int result); | 50 void HandleReadResult(int result); |
| 49 | 51 |
| 50 private: | 52 private: |
| 51 MessageLoop* message_loop_; | 53 base::MessageLoop* message_loop_; |
| 52 net::StreamSocket* host_socket_; | 54 net::StreamSocket* host_socket_; |
| 53 net::StreamSocket* client_socket_; | 55 net::StreamSocket* client_socket_; |
| 54 int message_size_; | 56 int message_size_; |
| 55 int test_data_size_; | 57 int test_data_size_; |
| 56 bool done_; | 58 bool done_; |
| 57 | 59 |
| 58 scoped_refptr<net::DrainableIOBuffer> output_buffer_; | 60 scoped_refptr<net::DrainableIOBuffer> output_buffer_; |
| 59 scoped_refptr<net::GrowableIOBuffer> input_buffer_; | 61 scoped_refptr<net::GrowableIOBuffer> input_buffer_; |
| 60 | 62 |
| 61 int write_errors_; | 63 int write_errors_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 76 | 78 |
| 77 private: | 79 private: |
| 78 void Done(); | 80 void Done(); |
| 79 void DoWrite(); | 81 void DoWrite(); |
| 80 void OnWritten(int result); | 82 void OnWritten(int result); |
| 81 void HandleWriteResult(int result); | 83 void HandleWriteResult(int result); |
| 82 void DoRead(); | 84 void DoRead(); |
| 83 void OnRead(int result); | 85 void OnRead(int result); |
| 84 void HandleReadResult(int result); | 86 void HandleReadResult(int result); |
| 85 | 87 |
| 86 MessageLoop* message_loop_; | 88 base::MessageLoop* message_loop_; |
| 87 net::Socket* host_socket_; | 89 net::Socket* host_socket_; |
| 88 net::Socket* client_socket_; | 90 net::Socket* client_socket_; |
| 89 int message_size_; | 91 int message_size_; |
| 90 int message_count_; | 92 int message_count_; |
| 91 int delay_ms_; | 93 int delay_ms_; |
| 92 bool done_; | 94 bool done_; |
| 93 | 95 |
| 94 std::vector<scoped_refptr<net::IOBuffer> > sent_packets_; | 96 std::vector<scoped_refptr<net::IOBuffer> > sent_packets_; |
| 95 scoped_refptr<net::IOBuffer> read_buffer_; | 97 scoped_refptr<net::IOBuffer> read_buffer_; |
| 96 | 98 |
| 97 int write_errors_; | 99 int write_errors_; |
| 98 int read_errors_; | 100 int read_errors_; |
| 99 int packets_sent_; | 101 int packets_sent_; |
| 100 int packets_received_; | 102 int packets_received_; |
| 101 int bad_packets_received_; | 103 int bad_packets_received_; |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 } // namespace protocol | 106 } // namespace protocol |
| 105 } // namespace remoting | 107 } // namespace remoting |
| 106 | 108 |
| 107 #endif // REMOTING_PROTOCOL_CONNECTION_TESTER_H_ | 109 #endif // REMOTING_PROTOCOL_CONNECTION_TESTER_H_ |
| OLD | NEW |