Chromium Code Reviews| 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 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 | 26 |
| 27 class HttpRequestHeaders; | 27 class HttpRequestHeaders; |
| 28 class HttpResponseHeaders; | 28 class HttpResponseHeaders; |
| 29 class HttpResponseInfo; | 29 class HttpResponseInfo; |
| 30 class HttpTransaction; | 30 class HttpTransaction; |
| 31 class HttpUserAgentSettings; | 31 class HttpUserAgentSettings; |
| 32 class ProxyInfo; | 32 class ProxyInfo; |
| 33 class UploadDataStream; | 33 class UploadDataStream; |
| 34 class URLRequestContext; | 34 class URLRequestContext; |
| 35 | 35 |
| 36 // TODO(battre) Remove this when crbug.com/289715 is fixed. | |
| 37 class URLRequestHttpJob; | |
| 38 void OnHeadersReceivedCallbackForDebugging(base::WeakPtr<URLRequestHttpJob>, | |
| 39 int); | |
|
mmenke
2015/01/09 16:54:51
optional: Think this is a little cleaner as a sta
battre
2015/01/09 18:02:30
Done.
| |
| 40 | |
| 36 // A URLRequestJob subclass that is built on top of HttpTransaction. It | 41 // A URLRequestJob subclass that is built on top of HttpTransaction. It |
| 37 // provides an implementation for both HTTP and HTTPS. | 42 // provides an implementation for both HTTP and HTTPS. |
| 38 class NET_EXPORT_PRIVATE URLRequestHttpJob : public URLRequestJob { | 43 class NET_EXPORT_PRIVATE URLRequestHttpJob : public URLRequestJob { |
| 39 public: | 44 public: |
| 40 static URLRequestJob* Factory(URLRequest* request, | 45 static URLRequestJob* Factory(URLRequest* request, |
| 41 NetworkDelegate* network_delegate, | 46 NetworkDelegate* network_delegate, |
| 42 const std::string& scheme); | 47 const std::string& scheme); |
| 43 | 48 |
| 44 protected: | 49 protected: |
| 45 URLRequestHttpJob(URLRequest* request, | 50 URLRequestHttpJob(URLRequest* request, |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 | 265 |
| 261 // Flag used to verify that |this| is not deleted while we are awaiting | 266 // Flag used to verify that |this| is not deleted while we are awaiting |
| 262 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. | 267 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. |
| 263 // True if we are waiting a callback and | 268 // True if we are waiting a callback and |
| 264 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, | 269 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, |
| 265 // to inform the NetworkDelegate that it may not call back. | 270 // to inform the NetworkDelegate that it may not call back. |
| 266 bool awaiting_callback_; | 271 bool awaiting_callback_; |
| 267 | 272 |
| 268 const HttpUserAgentSettings* http_user_agent_settings_; | 273 const HttpUserAgentSettings* http_user_agent_settings_; |
| 269 | 274 |
| 275 // TODO(battre) Remove this when crbug.com/289715 is fixed. | |
| 276 enum TransactionState { | |
| 277 TRANSACTION_WAS_NOT_INITIALIZED, | |
| 278 TRANSACTION_WAS_INITIALIZED, | |
| 279 TRANSACTION_WAS_DESTROYED | |
| 280 }; | |
| 281 TransactionState transaction_state_; | |
| 282 friend void OnHeadersReceivedCallbackForDebugging( | |
| 283 base::WeakPtr<URLRequestHttpJob>, | |
| 284 int); | |
| 285 | |
| 270 base::WeakPtrFactory<URLRequestHttpJob> weak_factory_; | 286 base::WeakPtrFactory<URLRequestHttpJob> weak_factory_; |
| 271 | 287 |
| 272 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); | 288 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); |
| 273 }; | 289 }; |
| 274 | 290 |
| 275 } // namespace net | 291 } // namespace net |
| 276 | 292 |
| 277 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 293 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
| OLD | NEW |