| 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 HttpResponseHeaders; | 24 class HttpResponseHeaders; |
| 25 class HttpResponseInfo; | 25 class HttpResponseInfo; |
| 26 class HttpTransaction; | 26 class HttpTransaction; |
| 27 class HttpUserAgentSettings; |
| 27 class URLRequestContext; | 28 class URLRequestContext; |
| 28 | 29 |
| 29 // A URLRequestJob subclass that is built on top of HttpTransaction. It | 30 // A URLRequestJob subclass that is built on top of HttpTransaction. It |
| 30 // provides an implementation for both HTTP and HTTPS. | 31 // provides an implementation for both HTTP and HTTPS. |
| 31 class URLRequestHttpJob : public URLRequestJob { | 32 class URLRequestHttpJob : public URLRequestJob { |
| 32 public: | 33 public: |
| 33 static URLRequestJob* Factory(URLRequest* request, | 34 static URLRequestJob* Factory(URLRequest* request, |
| 34 NetworkDelegate* network_delegate, | 35 NetworkDelegate* network_delegate, |
| 35 const std::string& scheme); | 36 const std::string& scheme); |
| 36 | 37 |
| 37 protected: | 38 protected: |
| 38 URLRequestHttpJob(URLRequest* request, NetworkDelegate* network_delegate); | 39 URLRequestHttpJob(URLRequest* request, |
| 40 NetworkDelegate* network_delegate, |
| 41 const HttpUserAgentSettings* http_user_agent_settings); |
| 39 | 42 |
| 40 // Shadows URLRequestJob's version of this method so we can grab cookies. | 43 // Shadows URLRequestJob's version of this method so we can grab cookies. |
| 41 void NotifyHeadersComplete(); | 44 void NotifyHeadersComplete(); |
| 42 | 45 |
| 43 // Shadows URLRequestJob's method so we can record histograms. | 46 // Shadows URLRequestJob's method so we can record histograms. |
| 44 void NotifyDone(const URLRequestStatus& status); | 47 void NotifyDone(const URLRequestStatus& status); |
| 45 | 48 |
| 46 void DestroyTransaction(); | 49 void DestroyTransaction(); |
| 47 | 50 |
| 48 void AddExtraHeaders(); | 51 void AddExtraHeaders(); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 240 |
| 238 // Flag used to verify that |this| is not deleted while we are awaiting | 241 // Flag used to verify that |this| is not deleted while we are awaiting |
| 239 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. | 242 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. |
| 240 // True if we are waiting a callback and | 243 // True if we are waiting a callback and |
| 241 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, | 244 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, |
| 242 // to inform the NetworkDelegate that it may not call back. | 245 // to inform the NetworkDelegate that it may not call back. |
| 243 bool awaiting_callback_; | 246 bool awaiting_callback_; |
| 244 | 247 |
| 245 scoped_ptr<HttpTransactionDelegateImpl> http_transaction_delegate_; | 248 scoped_ptr<HttpTransactionDelegateImpl> http_transaction_delegate_; |
| 246 | 249 |
| 250 const HttpUserAgentSettings* http_user_agent_settings_; |
| 251 |
| 247 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); | 252 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); |
| 248 }; | 253 }; |
| 249 | 254 |
| 250 } // namespace net | 255 } // namespace net |
| 251 | 256 |
| 252 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 257 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
| OLD | NEW |