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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
13 #include "net/base/completion_callback.h" | 13 #include "net/base/completion_callback.h" |
14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
15 #include "net/url_request/url_request.h" | 15 #include "net/url_request/url_request.h" |
| 16 #include "net/url_request/url_request_context.h" |
16 | 17 |
17 namespace chrome_browser_net { | 18 namespace chrome_browser_net { |
18 | 19 |
19 // Class for performing a background test of users' Internet connections. | 20 // Class for performing a background test of users' Internet connections. |
20 // Fetches a collection of resources on a test server and verifies all were | 21 // Fetches a collection of resources on a test server and verifies all were |
21 // received correctly. This will be used to determine whether or not proxies are | 22 // received correctly. This will be used to determine whether or not proxies are |
22 // interfering with a user's ability to use HTTP pipelining. Results are | 23 // interfering with a user's ability to use HTTP pipelining. Results are |
23 // recorded with UMA. | 24 // recorded with UMA. |
24 // | 25 // |
25 // TODO(simonjam): Connect this to something. We should start with a field trial | 26 // TODO(simonjam): Connect this to something. We should start with a field trial |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 112 |
112 // Called when a Request determines its HTTP response code. Reports to UMA. | 113 // Called when a Request determines its HTTP response code. Reports to UMA. |
113 void ReportResponseCode(int request_id, int response_code); | 114 void ReportResponseCode(int request_id, int response_code); |
114 | 115 |
115 // Returns the full UMA metric name based on |request_id| and |description|. | 116 // Returns the full UMA metric name based on |request_id| and |description|. |
116 std::string GetMetricName(int request_id, const char* description); | 117 std::string GetMetricName(int request_id, const char* description); |
117 | 118 |
118 ScopedVector<Request> requests_; | 119 ScopedVector<Request> requests_; |
119 net::CompletionCallback finished_callback_; | 120 net::CompletionCallback finished_callback_; |
120 size_t num_finished_; | 121 size_t num_finished_; |
| 122 scoped_ptr<net::HttpTransactionFactory> http_transaction_factory_; |
| 123 scoped_refptr<net::URLRequestContext> url_request_context_; |
121 }; | 124 }; |
122 | 125 |
123 } // namespace chrome_browser_net | 126 } // namespace chrome_browser_net |
124 | 127 |
125 #endif // CHROME_BROWSER_NET_HTTP_PIPELINING_COMPATIBILITY_CLIENT_H_ | 128 #endif // CHROME_BROWSER_NET_HTTP_PIPELINING_COMPATIBILITY_CLIENT_H_ |
OLD | NEW |