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