| 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 <list> | 8 #include <list> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 14 | 14 #include "base/single_thread_task_runner.h" |
| 15 namespace base { | |
| 16 class MessageLoop; | |
| 17 } // namespace base | |
| 18 | 15 |
| 19 namespace net { | 16 namespace net { |
| 20 class DrainableIOBuffer; | 17 class DrainableIOBuffer; |
| 21 class GrowableIOBuffer; | 18 class GrowableIOBuffer; |
| 22 class IOBuffer; | 19 class IOBuffer; |
| 23 } // namespace net | 20 } // namespace net |
| 24 | 21 |
| 25 namespace remoting { | 22 namespace remoting { |
| 26 | 23 |
| 27 class CompoundBuffer; | 24 class CompoundBuffer; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 52 void Done(); | 49 void Done(); |
| 53 void InitBuffers(); | 50 void InitBuffers(); |
| 54 void DoWrite(); | 51 void DoWrite(); |
| 55 void OnWritten(int result); | 52 void OnWritten(int result); |
| 56 void HandleWriteResult(int result); | 53 void HandleWriteResult(int result); |
| 57 void DoRead(); | 54 void DoRead(); |
| 58 void OnRead(int result); | 55 void OnRead(int result); |
| 59 void HandleReadResult(int result); | 56 void HandleReadResult(int result); |
| 60 | 57 |
| 61 private: | 58 private: |
| 62 base::MessageLoop* message_loop_; | 59 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 63 P2PStreamSocket* host_socket_; | 60 P2PStreamSocket* host_socket_; |
| 64 P2PStreamSocket* client_socket_; | 61 P2PStreamSocket* client_socket_; |
| 65 int message_size_; | 62 int message_size_; |
| 66 int test_data_size_; | 63 int test_data_size_; |
| 67 bool done_; | 64 bool done_; |
| 68 | 65 |
| 69 scoped_refptr<net::DrainableIOBuffer> output_buffer_; | 66 scoped_refptr<net::DrainableIOBuffer> output_buffer_; |
| 70 scoped_refptr<net::GrowableIOBuffer> input_buffer_; | 67 scoped_refptr<net::GrowableIOBuffer> input_buffer_; |
| 71 | 68 |
| 72 int write_errors_; | 69 int write_errors_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 87 | 84 |
| 88 private: | 85 private: |
| 89 void Done(); | 86 void Done(); |
| 90 void DoWrite(); | 87 void DoWrite(); |
| 91 void OnWritten(int result); | 88 void OnWritten(int result); |
| 92 void HandleWriteResult(int result); | 89 void HandleWriteResult(int result); |
| 93 void DoRead(); | 90 void DoRead(); |
| 94 void OnRead(int result); | 91 void OnRead(int result); |
| 95 void HandleReadResult(int result); | 92 void HandleReadResult(int result); |
| 96 | 93 |
| 97 base::MessageLoop* message_loop_; | 94 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 98 P2PDatagramSocket* host_socket_; | 95 P2PDatagramSocket* host_socket_; |
| 99 P2PDatagramSocket* client_socket_; | 96 P2PDatagramSocket* client_socket_; |
| 100 int message_size_; | 97 int message_size_; |
| 101 int message_count_; | 98 int message_count_; |
| 102 int delay_ms_; | 99 int delay_ms_; |
| 103 bool done_; | 100 bool done_; |
| 104 | 101 |
| 105 std::vector<scoped_refptr<net::IOBuffer> > sent_packets_; | 102 std::vector<scoped_refptr<net::IOBuffer> > sent_packets_; |
| 106 scoped_refptr<net::IOBuffer> read_buffer_; | 103 scoped_refptr<net::IOBuffer> read_buffer_; |
| 107 | 104 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 133 int message_count_; | 130 int message_count_; |
| 134 | 131 |
| 135 std::vector<std::unique_ptr<VideoPacket>> sent_messages_; | 132 std::vector<std::unique_ptr<VideoPacket>> sent_messages_; |
| 136 std::vector<std::unique_ptr<VideoPacket>> received_messages_; | 133 std::vector<std::unique_ptr<VideoPacket>> received_messages_; |
| 137 }; | 134 }; |
| 138 | 135 |
| 139 } // namespace protocol | 136 } // namespace protocol |
| 140 } // namespace remoting | 137 } // namespace remoting |
| 141 | 138 |
| 142 #endif // REMOTING_PROTOCOL_CONNECTION_TESTER_H_ | 139 #endif // REMOTING_PROTOCOL_CONNECTION_TESTER_H_ |
| OLD | NEW |