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 NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/time.h" | 14 #include "base/time.h" |
15 #include "net/base/auth.h" | 15 #include "net/base/auth.h" |
16 #include "net/base/completion_callback.h" | 16 #include "net/base/completion_callback.h" |
17 #include "net/cookies/cookie_store.h" | 17 #include "net/cookies/cookie_store.h" |
18 #include "net/http/http_request_info.h" | 18 #include "net/http/http_request_info.h" |
19 #include "net/url_request/url_request_job.h" | 19 #include "net/url_request/url_request_job.h" |
20 #include "net/url_request/url_request_throttler_entry_interface.h" | 20 #include "net/url_request/url_request_throttler_entry_interface.h" |
21 | 21 |
22 namespace net { | 22 namespace net { |
23 | 23 |
24 class CookieStore; | |
25 class FraudulentCertificateReporter; | |
24 class HttpResponseHeaders; | 26 class HttpResponseHeaders; |
25 class HttpResponseInfo; | 27 class HttpResponseInfo; |
26 class HttpTransaction; | 28 class HttpTransaction; |
29 class HttpTransactionFactory; | |
30 class NetworkDelegate; | |
31 class SSLConfigService; | |
32 class TransportSecurityState; | |
27 class URLRequestContext; | 33 class URLRequestContext; |
34 class URLRequestThrottlerManager; | |
28 | 35 |
29 // A URLRequestJob subclass that is built on top of HttpTransaction. It | 36 // A URLRequestJob subclass that is built on top of HttpTransaction. It |
30 // provides an implementation for both HTTP and HTTPS. | 37 // provides an implementation for both HTTP and HTTPS. |
31 class URLRequestHttpJob : public URLRequestJob { | 38 class URLRequestHttpJob : public URLRequestJob { |
32 public: | 39 public: |
40 friend class HttpProtocolHandler; | |
mmenke
2012/07/24 15:24:34
This should be at the top of the private section.
shalev
2012/07/25 20:22:45
Done.
| |
33 static URLRequestJob* Factory(URLRequest* request, | 41 static URLRequestJob* Factory(URLRequest* request, |
34 const std::string& scheme); | 42 const std::string& scheme); |
35 | 43 |
36 protected: | 44 protected: |
37 explicit URLRequestHttpJob(URLRequest* request); | 45 URLRequestHttpJob( |
46 URLRequest* request, | |
47 HttpTransactionFactory* http_transaction_factory, | |
48 NetworkDelegate* network_delegate, | |
49 URLRequestThrottlerManager* throttler_manager, | |
50 const std::string& accept_language, | |
51 const std::string& accept_charset, | |
52 CookieStore* cookie_store, | |
53 FraudulentCertificateReporter* fraudulent_certificate_reporter, | |
54 SSLConfigService* ssl_config_service, | |
55 TransportSecurityState* transport_security_state); | |
38 | 56 |
39 // Shadows URLRequestJob's version of this method so we can grab cookies. | 57 // Shadows URLRequestJob's version of this method so we can grab cookies. |
40 void NotifyHeadersComplete(); | 58 void NotifyHeadersComplete(); |
41 | 59 |
42 // Shadows URLRequestJob's method so we can record histograms. | 60 // Shadows URLRequestJob's method so we can record histograms. |
43 void NotifyDone(const URLRequestStatus& status); | 61 void NotifyDone(const URLRequestStatus& status); |
44 | 62 |
45 void DestroyTransaction(); | 63 void DestroyTransaction(); |
46 | 64 |
47 void AddExtraHeaders(); | 65 void AddExtraHeaders(); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
227 // layers of the network stack. | 245 // layers of the network stack. |
228 scoped_refptr<HttpResponseHeaders> override_response_headers_; | 246 scoped_refptr<HttpResponseHeaders> override_response_headers_; |
229 | 247 |
230 // Flag used to verify that |this| is not deleted while we are awaiting | 248 // Flag used to verify that |this| is not deleted while we are awaiting |
231 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. | 249 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. |
232 // True if we are waiting a callback and | 250 // True if we are waiting a callback and |
233 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, | 251 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, |
234 // to inform the NetworkDelegate that it may not call back. | 252 // to inform the NetworkDelegate that it may not call back. |
235 bool awaiting_callback_; | 253 bool awaiting_callback_; |
236 | 254 |
255 HttpTransactionFactory* http_transaction_factory_; | |
256 NetworkDelegate* network_delegate_; | |
257 URLRequestThrottlerManager* throttler_manager_; | |
258 const std::string accept_language_; | |
259 const std::string accept_charset_; | |
260 CookieStore* cookie_store_; | |
261 FraudulentCertificateReporter* fraudulent_certificate_reporter_; | |
262 SSLConfigService* ssl_config_service_; | |
263 TransportSecurityState* transport_security_state_; | |
264 | |
237 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); | 265 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); |
238 }; | 266 }; |
239 | 267 |
240 } // namespace net | 268 } // namespace net |
241 | 269 |
242 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 270 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
OLD | NEW |