OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CHROME_BROWSER_NET_NETWORK_STATS_H_ | 5 #ifndef CHROME_BROWSER_NET_NETWORK_STATS_H_ |
6 #define CHROME_BROWSER_NET_NETWORK_STATS_H_ | 6 #define CHROME_BROWSER_NET_NETWORK_STATS_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 // This function calls TestPhaseComplete() if there is a significant network | 135 // This function calls TestPhaseComplete() if there is a significant network |
136 // error or if all packets in the current test are received. | 136 // error or if all packets in the current test are received. |
137 // Return true if TestPhaseComplete() is called otherwise return false. | 137 // Return true if TestPhaseComplete() is called otherwise return false. |
138 bool ReadComplete(int result); | 138 bool ReadComplete(int result); |
139 | 139 |
140 // Callbacks when an internal IO (Read or Write) is completed. | 140 // Callbacks when an internal IO (Read or Write) is completed. |
141 void OnReadComplete(int result); | 141 void OnReadComplete(int result); |
142 void OnWriteComplete(int result); | 142 void OnWriteComplete(int result); |
143 | 143 |
144 // Read data from server until an error or IO blocking occurs or reading is | 144 // Read data from server until an error or IO blocking occurs or reading is |
145 // complete. | 145 // complete. Return the result value from socket reading and 0 if |socket_| |
146 void ReadData(); | 146 // is Null. |
| 147 int ReadData(); |
147 | 148 |
148 // Send data contained in |str| to server. | 149 // Send data contained in |str| to server. |
149 // Return a negative value if IO blocking occurs or there is an error. | 150 // Return a negative value if IO blocking occurs or there is an error. |
150 // Otherwise return net::OK. | 151 // Otherwise return net::OK. |
151 int SendData(const std::string& str); | 152 int SendData(const std::string& str); |
152 | 153 |
153 // Update the send buffer (telling it that |bytes_sent| has been sent). | 154 // Update the send buffer (telling it that |bytes_sent| has been sent). |
154 // And reset |write_buffer_|. | 155 // And reset |write_buffer_|. |
155 void UpdateSendBuffer(int bytes_sent); | 156 void UpdateSendBuffer(int bytes_sent); |
156 | 157 |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 // This starts a series of tests randomly selected among one of the three | 356 // This starts a series of tests randomly selected among one of the three |
356 // choices of probe packet sizes: 100 Bytes, 500 Bytes, 1200 Bytes. | 357 // choices of probe packet sizes: 100 Bytes, 500 Bytes, 1200 Bytes. |
357 void StartNetworkStatsTest(net::HostResolver* host_resolver, | 358 void StartNetworkStatsTest(net::HostResolver* host_resolver, |
358 const net::HostPortPair& server_address, | 359 const net::HostPortPair& server_address, |
359 uint16 histogram_port, | 360 uint16 histogram_port, |
360 bool has_proxy_server); | 361 bool has_proxy_server); |
361 | 362 |
362 } // namespace chrome_browser_net | 363 } // namespace chrome_browser_net |
363 | 364 |
364 #endif // CHROME_BROWSER_NET_NETWORK_STATS_H_ | 365 #endif // CHROME_BROWSER_NET_NETWORK_STATS_H_ |
OLD | NEW |