| 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/base/net_export.h" |
| 17 #include "net/cookies/cookie_store.h" | 18 #include "net/cookies/cookie_store.h" |
| 18 #include "net/http/http_request_info.h" | 19 #include "net/http/http_request_info.h" |
| 19 #include "net/url_request/url_request_job.h" | 20 #include "net/url_request/url_request_job.h" |
| 20 #include "net/url_request/url_request_throttler_entry_interface.h" | 21 #include "net/url_request/url_request_throttler_entry_interface.h" |
| 21 | 22 |
| 22 namespace net { | 23 namespace net { |
| 23 | 24 |
| 24 class HttpResponseHeaders; | 25 class HttpResponseHeaders; |
| 25 class HttpResponseInfo; | 26 class HttpResponseInfo; |
| 26 class HttpTransaction; | 27 class HttpTransaction; |
| 27 class HttpUserAgentSettings; | 28 class HttpUserAgentSettings; |
| 28 class UploadDataStream; | 29 class UploadDataStream; |
| 29 class URLRequestContext; | 30 class URLRequestContext; |
| 30 | 31 |
| 31 // A URLRequestJob subclass that is built on top of HttpTransaction. It | 32 // A URLRequestJob subclass that is built on top of HttpTransaction. It |
| 32 // provides an implementation for both HTTP and HTTPS. | 33 // provides an implementation for both HTTP and HTTPS. |
| 33 class URLRequestHttpJob : public URLRequestJob { | 34 class NET_EXPORT_PRIVATE URLRequestHttpJob : public URLRequestJob { |
| 34 public: | 35 public: |
| 35 static URLRequestJob* Factory(URLRequest* request, | 36 static URLRequestJob* Factory(URLRequest* request, |
| 36 NetworkDelegate* network_delegate, | 37 NetworkDelegate* network_delegate, |
| 37 const std::string& scheme); | 38 const std::string& scheme); |
| 38 | 39 |
| 39 protected: | 40 protected: |
| 40 URLRequestHttpJob(URLRequest* request, | 41 URLRequestHttpJob(URLRequest* request, |
| 41 NetworkDelegate* network_delegate, | 42 NetworkDelegate* network_delegate, |
| 42 const HttpUserAgentSettings* http_user_agent_settings); | 43 const HttpUserAgentSettings* http_user_agent_settings); |
| 43 | 44 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 virtual void SetAuth(const AuthCredentials& credentials) OVERRIDE; | 92 virtual void SetAuth(const AuthCredentials& credentials) OVERRIDE; |
| 92 virtual void CancelAuth() OVERRIDE; | 93 virtual void CancelAuth() OVERRIDE; |
| 93 virtual void ContinueWithCertificate(X509Certificate* client_cert) OVERRIDE; | 94 virtual void ContinueWithCertificate(X509Certificate* client_cert) OVERRIDE; |
| 94 virtual void ContinueDespiteLastError() OVERRIDE; | 95 virtual void ContinueDespiteLastError() OVERRIDE; |
| 95 virtual bool ReadRawData(IOBuffer* buf, int buf_size, | 96 virtual bool ReadRawData(IOBuffer* buf, int buf_size, |
| 96 int* bytes_read) OVERRIDE; | 97 int* bytes_read) OVERRIDE; |
| 97 virtual void StopCaching() OVERRIDE; | 98 virtual void StopCaching() OVERRIDE; |
| 98 virtual void DoneReading() OVERRIDE; | 99 virtual void DoneReading() OVERRIDE; |
| 99 virtual HostPortPair GetSocketAddress() const OVERRIDE; | 100 virtual HostPortPair GetSocketAddress() const OVERRIDE; |
| 100 virtual void NotifyURLRequestDestroyed() OVERRIDE; | 101 virtual void NotifyURLRequestDestroyed() OVERRIDE; |
| 102 virtual void SetPriority(RequestPriority priority) OVERRIDE; |
| 101 | 103 |
| 102 HttpRequestInfo request_info_; | 104 HttpRequestInfo request_info_; |
| 103 const HttpResponseInfo* response_info_; | 105 const HttpResponseInfo* response_info_; |
| 104 | 106 |
| 105 std::vector<std::string> response_cookies_; | 107 std::vector<std::string> response_cookies_; |
| 106 size_t response_cookies_save_index_; | 108 size_t response_cookies_save_index_; |
| 107 base::Time response_date_; | 109 base::Time response_date_; |
| 108 | 110 |
| 109 // Auth states for proxy and origin server. | 111 // Auth states for proxy and origin server. |
| 110 AuthState proxy_auth_state_; | 112 AuthState proxy_auth_state_; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 134 // For SDCH latency experiments, when we are able to do SDCH, we may enable | 136 // For SDCH latency experiments, when we are able to do SDCH, we may enable |
| 135 // either an SDCH latency test xor a pass through test. The following bools | 137 // either an SDCH latency test xor a pass through test. The following bools |
| 136 // indicate what we decided on for this instance. | 138 // indicate what we decided on for this instance. |
| 137 bool sdch_test_activated_; // Advertising a dictionary for sdch. | 139 bool sdch_test_activated_; // Advertising a dictionary for sdch. |
| 138 bool sdch_test_control_; // Not even accepting-content sdch. | 140 bool sdch_test_control_; // Not even accepting-content sdch. |
| 139 | 141 |
| 140 // For recording of stats, we need to remember if this is cached content. | 142 // For recording of stats, we need to remember if this is cached content. |
| 141 bool is_cached_content_; | 143 bool is_cached_content_; |
| 142 | 144 |
| 143 private: | 145 private: |
| 146 friend class URLRequestHttpJobTest; |
| 147 |
| 144 enum CompletionCause { | 148 enum CompletionCause { |
| 145 ABORTED, | 149 ABORTED, |
| 146 FINISHED | 150 FINISHED |
| 147 }; | 151 }; |
| 148 | 152 |
| 149 typedef base::RefCountedData<bool> SharedBoolean; | 153 typedef base::RefCountedData<bool> SharedBoolean; |
| 150 | 154 |
| 151 class HttpFilterContext; | 155 class HttpFilterContext; |
| 152 class HttpTransactionDelegateImpl; | 156 class HttpTransactionDelegateImpl; |
| 153 | 157 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 scoped_ptr<HttpTransactionDelegateImpl> http_transaction_delegate_; | 253 scoped_ptr<HttpTransactionDelegateImpl> http_transaction_delegate_; |
| 250 | 254 |
| 251 const HttpUserAgentSettings* http_user_agent_settings_; | 255 const HttpUserAgentSettings* http_user_agent_settings_; |
| 252 | 256 |
| 253 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); | 257 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); |
| 254 }; | 258 }; |
| 255 | 259 |
| 256 } // namespace net | 260 } // namespace net |
| 257 | 261 |
| 258 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ | 262 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ |
| OLD | NEW |