Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: net/url_request/url_request_http_job.h

Issue 10702137: Replaced static URLRequestHTTPJob factory with non-static protocol handler for HTTP jobs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Hack to fix tests Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/url_request/http_protocol_handler.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CookieStore;
25 class FraudulentCertificateReporter;
24 class HttpResponseHeaders; 26 class HttpResponseHeaders;
25 class HttpResponseInfo; 27 class HttpResponseInfo;
26 class HttpTransaction; 28 class HttpTransaction;
29 class HttpTransactionFactory;
30 class NetworkDelegate;
31 class SSLConfigService;
32 class TransportSecurityState;
27 class URLRequestContext; 33 class URLRequestContext;
34 class URLRequestThrottlerManager;
28 35
29 // A URLRequestJob subclass that is built on top of HttpTransaction. It 36 // A URLRequestJob subclass that is built on top of HttpTransaction. It
30 // provides an implementation for both HTTP and HTTPS. 37 // provides an implementation for both HTTP and HTTPS.
31 class URLRequestHttpJob : public URLRequestJob { 38 class URLRequestHttpJob : public URLRequestJob {
32 public: 39 public:
33 static URLRequestJob* Factory(URLRequest* request, 40 static URLRequestJob* Factory(URLRequest* request,
34 const std::string& scheme); 41 const std::string& scheme);
35 42
36 protected: 43 protected:
37 explicit URLRequestHttpJob(URLRequest* request); 44 URLRequestHttpJob(
45 URLRequest* request,
46 HttpTransactionFactory* http_transaction_factory,
47 NetworkDelegate* network_delegate,
48 URLRequestThrottlerManager* throttler_manager,
49 const std::string& accept_language,
50 const std::string& accept_charset,
51 CookieStore* cookie_store,
52 FraudulentCertificateReporter* fraudulent_certificate_reporter,
53 SSLConfigService* ssl_config_service,
54 TransportSecurityState* transport_security_state);
38 55
39 // Shadows URLRequestJob's version of this method so we can grab cookies. 56 // Shadows URLRequestJob's version of this method so we can grab cookies.
40 void NotifyHeadersComplete(); 57 void NotifyHeadersComplete();
41 58
42 // Shadows URLRequestJob's method so we can record histograms. 59 // Shadows URLRequestJob's method so we can record histograms.
43 void NotifyDone(const URLRequestStatus& status); 60 void NotifyDone(const URLRequestStatus& status);
44 61
45 void DestroyTransaction(); 62 void DestroyTransaction();
46 63
47 void AddExtraHeaders(); 64 void AddExtraHeaders();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 // For SDCH latency experiments, when we are able to do SDCH, we may enable 144 // For SDCH latency experiments, when we are able to do SDCH, we may enable
128 // either an SDCH latency test xor a pass through test. The following bools 145 // either an SDCH latency test xor a pass through test. The following bools
129 // indicate what we decided on for this instance. 146 // indicate what we decided on for this instance.
130 bool sdch_test_activated_; // Advertising a dictionary for sdch. 147 bool sdch_test_activated_; // Advertising a dictionary for sdch.
131 bool sdch_test_control_; // Not even accepting-content sdch. 148 bool sdch_test_control_; // Not even accepting-content sdch.
132 149
133 // For recording of stats, we need to remember if this is cached content. 150 // For recording of stats, we need to remember if this is cached content.
134 bool is_cached_content_; 151 bool is_cached_content_;
135 152
136 private: 153 private:
154 friend class HttpProtocolHandler;
137 enum CompletionCause { 155 enum CompletionCause {
138 ABORTED, 156 ABORTED,
139 FINISHED 157 FINISHED
140 }; 158 };
141 159
142 typedef base::RefCountedData<bool> SharedBoolean; 160 typedef base::RefCountedData<bool> SharedBoolean;
143 161
144 class HttpFilterContext; 162 class HttpFilterContext;
145 class HttpTransactionDelegateImpl; 163 class HttpTransactionDelegateImpl;
146 164
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 scoped_refptr<HttpResponseHeaders> override_response_headers_; 250 scoped_refptr<HttpResponseHeaders> override_response_headers_;
233 251
234 // Flag used to verify that |this| is not deleted while we are awaiting 252 // Flag used to verify that |this| is not deleted while we are awaiting
235 // a callback from the NetworkDelegate. Used as a fail-fast mechanism. 253 // a callback from the NetworkDelegate. Used as a fail-fast mechanism.
236 // True if we are waiting a callback and 254 // True if we are waiting a callback and
237 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet, 255 // NetworkDelegate::NotifyURLRequestDestroyed has not been called, yet,
238 // to inform the NetworkDelegate that it may not call back. 256 // to inform the NetworkDelegate that it may not call back.
239 bool awaiting_callback_; 257 bool awaiting_callback_;
240 258
241 scoped_ptr<HttpTransactionDelegateImpl> http_transaction_delegate_; 259 scoped_ptr<HttpTransactionDelegateImpl> http_transaction_delegate_;
260 HttpTransactionFactory* http_transaction_factory_;
261 NetworkDelegate* network_delegate_;
262 URLRequestThrottlerManager* throttler_manager_;
263 const std::string accept_language_;
264 const std::string accept_charset_;
265 CookieStore* cookie_store_;
266 FraudulentCertificateReporter* fraudulent_certificate_reporter_;
267 SSLConfigService* ssl_config_service_;
268 TransportSecurityState* transport_security_state_;
242 269
243 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob); 270 DISALLOW_COPY_AND_ASSIGN(URLRequestHttpJob);
244 }; 271 };
245 272
246 } // namespace net 273 } // namespace net
247 274
248 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_ 275 #endif // NET_URL_REQUEST_URL_REQUEST_HTTP_JOB_H_
OLDNEW
« no previous file with comments | « net/url_request/http_protocol_handler.cc ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698