| 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/time.h" | 14 #include "base/time/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/base/net_export.h" | 17 #include "net/base/net_export.h" |
| 18 #include "net/base/sdch_manager.h" | 18 #include "net/base/sdch_manager.h" |
| 19 #include "net/cookies/cookie_store.h" | 19 #include "net/cookies/cookie_store.h" |
| 20 #include "net/filter/filter.h" | 20 #include "net/filter/filter.h" |
| 21 #include "net/http/http_request_info.h" | 21 #include "net/http/http_request_info.h" |
| 22 #include "net/socket/connection_attempts.h" | 22 #include "net/socket/connection_attempts.h" |
| 23 #include "net/url_request/url_request_backoff_manager.h" |
| 23 #include "net/url_request/url_request_job.h" | 24 #include "net/url_request/url_request_job.h" |
| 24 #include "net/url_request/url_request_throttler_entry_interface.h" | 25 #include "net/url_request/url_request_throttler_entry_interface.h" |
| 25 | 26 |
| 26 namespace net { | 27 namespace net { |
| 27 | 28 |
| 28 class HttpRequestHeaders; | 29 class HttpRequestHeaders; |
| 29 class HttpResponseHeaders; | 30 class HttpResponseHeaders; |
| 30 class HttpResponseInfo; | 31 class HttpResponseInfo; |
| 31 class HttpTransaction; | 32 class HttpTransaction; |
| 32 class HttpUserAgentSettings; | 33 class HttpUserAgentSettings; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 62 private: | 63 private: |
| 63 enum CompletionCause { | 64 enum CompletionCause { |
| 64 ABORTED, | 65 ABORTED, |
| 65 FINISHED | 66 FINISHED |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 typedef base::RefCountedData<bool> SharedBoolean; | 69 typedef base::RefCountedData<bool> SharedBoolean; |
| 69 | 70 |
| 70 class HttpFilterContext; | 71 class HttpFilterContext; |
| 71 | 72 |
| 73 // Shadows URLRequestJob's version of this method. |
| 74 void NotifyBeforeNetworkStart(bool* defer); |
| 75 |
| 72 // Shadows URLRequestJob's version of this method so we can grab cookies. | 76 // Shadows URLRequestJob's version of this method so we can grab cookies. |
| 73 void NotifyHeadersComplete(); | 77 void NotifyHeadersComplete(); |
| 74 | 78 |
| 75 // Shadows URLRequestJob's method so we can record histograms. | 79 // Shadows URLRequestJob's method so we can record histograms. |
| 76 void NotifyDone(const URLRequestStatus& status); | 80 void NotifyDone(const URLRequestStatus& status); |
| 77 | 81 |
| 78 void DestroyTransaction(); | 82 void DestroyTransaction(); |
| 79 | 83 |
| 80 void AddExtraHeaders(); | 84 void AddExtraHeaders(); |
| 81 void AddCookieHeaderAndStart(); | 85 void AddCookieHeaderAndStart(); |
| 82 void SaveCookiesAndNotifyHeadersComplete(int result); | 86 void SaveCookiesAndNotifyHeadersComplete(int result); |
| 83 void SaveNextCookie(); | 87 void SaveNextCookie(); |
| 84 void FetchResponseCookies(std::vector<std::string>* cookies); | 88 void FetchResponseCookies(std::vector<std::string>* cookies); |
| 85 | 89 |
| 90 // Processes a Backoff header, if one exists. |
| 91 void ProcessBackoffHeader(); |
| 92 |
| 86 // Processes the Strict-Transport-Security header, if one exists. | 93 // Processes the Strict-Transport-Security header, if one exists. |
| 87 void ProcessStrictTransportSecurityHeader(); | 94 void ProcessStrictTransportSecurityHeader(); |
| 88 | 95 |
| 89 // Processes the Public-Key-Pins header, if one exists. | 96 // Processes the Public-Key-Pins header, if one exists. |
| 90 void ProcessPublicKeyPinsHeader(); | 97 void ProcessPublicKeyPinsHeader(); |
| 91 | 98 |
| 92 // |result| should be OK, or the request is canceled. | 99 // |result| should be OK, or the request is canceled. |
| 93 void OnHeadersReceivedCallback(int result); | 100 void OnHeadersReceivedCallback(int result); |
| 94 void OnStartCompleted(int result); | 101 void OnStartCompleted(int result); |
| 95 void OnReadCompleted(int result); | 102 void OnReadCompleted(int result); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 | 265 |
| 259 // 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 |
| 260 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. | 267 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. |
| 261 // True if we are waiting a callback and | 268 // True if we are waiting a callback and |
| 262 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, | 269 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, |
| 263 // to inform the NetworkDelegate that it may not call back. | 270 // to inform the NetworkDelegate that it may not call back. |
| 264 bool awaiting_callback_; | 271 bool awaiting_callback_; |
| 265 | 272 |
| 266 const HttpUserAgentSettings* http_user_agent_settings_; | 273 const HttpUserAgentSettings* http_user_agent_settings_; |
| 267 | 274 |
| 275 URLRequestBackoffManager* backoff_manager_; |
| 276 |
| 268 base::WeakPtrFactory<URLRequestHttpJob> weak_factory_; | 277 base::WeakPtrFactory<URLRequestHttpJob> weak_factory_; |
| 269 | 278 |
| 270 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); | 279 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); |
| 271 }; | 280 }; |
| 272 | 281 |
| 273 } // namespace net | 282 } // namespace net |
| 274 | 283 |
| 275 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 284 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
| OLD | NEW |