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 CHROME_BROWSER_NET_HTTP_PIPELINING_COMPATIBILITY_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_NET_HTTP_PIPELINING_COMPATIBILITY_CLIENT_H_ |
6 #define CHROME_BROWSER_NET_HTTP_PIPELINING_COMPATIBILITY_CLIENT_H_ | 6 #define CHROME_BROWSER_NET_HTTP_PIPELINING_COMPATIBILITY_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 public: | 101 public: |
102 enum Options { | 102 enum Options { |
103 PIPE_TEST_DEFAULTS, // Only run the |requests| passed to Start. | 103 PIPE_TEST_DEFAULTS, // Only run the |requests| passed to Start. |
104 PIPE_TEST_RUN_CANARY_REQUEST, // Also perform a canary request before | 104 PIPE_TEST_RUN_CANARY_REQUEST, // Also perform a canary request before |
105 // testing pipelining. | 105 // testing pipelining. |
106 PIPE_TEST_COLLECT_SERVER_STATS, // Also request stats from the server after | 106 PIPE_TEST_COLLECT_SERVER_STATS, // Also request stats from the server after |
107 // the pipeline test completes. | 107 // the pipeline test completes. |
108 PIPE_TEST_CANARY_AND_STATS, // Both of the above. | 108 PIPE_TEST_CANARY_AND_STATS, // Both of the above. |
109 }; | 109 }; |
110 | 110 |
111 HttpPipeliningCompatibilityClient( | 111 explicit HttpPipeliningCompatibilityClient( |
112 internal::PipelineTestRequest::Factory* factory); | 112 internal::PipelineTestRequest::Factory* factory); |
113 virtual ~HttpPipeliningCompatibilityClient(); | 113 virtual ~HttpPipeliningCompatibilityClient(); |
114 | 114 |
115 // Launches the asynchronous URLRequests to fetch the URLs specified by | 115 // Launches the asynchronous URLRequests to fetch the URLs specified by |
116 // |requests| combined with |base_url|. |base_url| should match the pattern | 116 // |requests| combined with |base_url|. |base_url| should match the pattern |
117 // "http://host/". |callback| is invoked once all the requests have completed. | 117 // "http://host/". |callback| is invoked once all the requests have completed. |
118 // URLRequests are initiated in |url_request_context|. Results are recorded to | 118 // URLRequests are initiated in |url_request_context|. Results are recorded to |
119 // UMA as they are received. If |collect_server_stats| is true, also collects | 119 // UMA as they are received. If |collect_server_stats| is true, also collects |
120 // pipelining information recorded by the server. | 120 // pipelining information recorded by the server. |
121 void Start(const std::string& base_url, | 121 void Start(const std::string& base_url, |
(...skipping 27 matching lines...) Expand all Loading... |
149 size_t num_finished_; | 149 size_t num_finished_; |
150 size_t num_succeeded_; | 150 size_t num_succeeded_; |
151 }; | 151 }; |
152 | 152 |
153 void CollectPipeliningCapabilityStatsOnUIThread( | 153 void CollectPipeliningCapabilityStatsOnUIThread( |
154 const std::string& pipeline_test_server, IOThread* io_thread); | 154 const std::string& pipeline_test_server, IOThread* io_thread); |
155 | 155 |
156 } // namespace chrome_browser_net | 156 } // namespace chrome_browser_net |
157 | 157 |
158 #endif // CHROME_BROWSER_NET_HTTP_PIPELINING_COMPATIBILITY_CLIENT_H_ | 158 #endif // CHROME_BROWSER_NET_HTTP_PIPELINING_COMPATIBILITY_CLIENT_H_ |
OLD | NEW |