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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // 2. |PACED_PACKET_TEST| or |NON_PACED_PACKET_TEST|: After the first test, | 48 // 2. |PACED_PACKET_TEST| or |NON_PACED_PACKET_TEST|: After the first test, |
49 // 21 packets are sent from the server to the client with or without pacing. | 49 // 21 packets are sent from the server to the client with or without pacing. |
50 // If pacing, the pacing rate is computed from the first test. | 50 // If pacing, the pacing rate is computed from the first test. |
51 // 3. |NAT_BIND_TEST|: 2 packets are sent from the server to the client with | 51 // 3. |NAT_BIND_TEST|: 2 packets are sent from the server to the client with |
52 // a randomly generated delay of 1~300 seconds. | 52 // a randomly generated delay of 1~300 seconds. |
53 // At the end of these tests, we send another HelloRequest to test whether | 53 // At the end of these tests, we send another HelloRequest to test whether |
54 // the network is still connected and has not changed (e.g. from Wifi to 3g). | 54 // the network is still connected and has not changed (e.g. from Wifi to 3g). |
55 | 55 |
56 class NetworkStats { | 56 class NetworkStats { |
57 public: | 57 public: |
58 enum Status { // Used in HISTOGRAM_ENUMERATION. | 58 enum Status { // Used in UMA_HISTOGRAM_ENUMERATION. |
59 SUCCESS, // Successfully received bytes from the server. | 59 SUCCESS, // Successfully received bytes from the server. |
60 SOCKET_CREATE_FAILED, // Socket creation failed. | 60 SOCKET_CREATE_FAILED, // Socket creation failed. |
61 RESOLVE_FAILED, // Host resolution failed. | 61 RESOLVE_FAILED, // Host resolution failed. |
62 CONNECT_FAILED, // Connection to the server failed. | 62 CONNECT_FAILED, // Connection to the server failed. |
63 WRITE_FAILED, // Sending a message to the server failed. | 63 WRITE_FAILED, // Sending a message to the server failed. |
64 READ_TIMED_OUT, // Reading the reply from the server timed out. | 64 READ_TIMED_OUT, // Reading the reply from the server timed out. |
65 READ_FAILED, // Reading the reply from the server failed. | 65 READ_FAILED, // Reading the reply from the server failed. |
66 STATUS_MAX, // Bounding value. | 66 STATUS_MAX, // Bounding value. |
67 }; | 67 }; |
68 | 68 |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 // This starts a series of tests randomly selected among one of the three | 381 // This starts a series of tests randomly selected among one of the three |
382 // choices of probe packet sizes: 100 Bytes, 500 Bytes, 1200 Bytes. | 382 // choices of probe packet sizes: 100 Bytes, 500 Bytes, 1200 Bytes. |
383 void StartNetworkStatsTest(net::HostResolver* host_resolver, | 383 void StartNetworkStatsTest(net::HostResolver* host_resolver, |
384 const net::HostPortPair& server_address, | 384 const net::HostPortPair& server_address, |
385 uint16 histogram_port, | 385 uint16 histogram_port, |
386 bool has_proxy_server); | 386 bool has_proxy_server); |
387 | 387 |
388 } // namespace chrome_browser_net | 388 } // namespace chrome_browser_net |
389 | 389 |
390 #endif // CHROME_BROWSER_NET_NETWORK_STATS_H_ | 390 #endif // CHROME_BROWSER_NET_NETWORK_STATS_H_ |
OLD | NEW |