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

Side by Side Diff: net/url_request/http_protocol_handler.cc

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: Fixed nits Created 8 years, 5 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "net/url_request/http_protocol_handler.h"
6
7 #include "base/logging.h"
8 #include "net/base/net_errors.h"
9 #include "net/url_request/url_request.h"
10 #include "net/url_request/url_request_error_job.h"
11 #include "net/url_request/url_request_http_job.h"
12 #include "net/url_request/url_request_redirect_job.h"
13
14 namespace net {
15
16 HttpProtocolHandler::HttpProtocolHandler(
17 HttpTransactionFactory* http_transaction_factory,
18 NetworkDelegate* network_delegate,
19 URLRequestThrottlerManager* throttler_manager,
20 const std::string& accept_language,
21 const std::string& accept_charset,
22 CookieStore* cookie_store,
23 FraudulentCertificateReporter* fraudulent_certificate_reporter,
24 SSLConfigService* ssl_config_service,
25 TransportSecurityState* transport_security_state)
26 : http_transaction_factory_(http_transaction_factory),
27 network_delegate_(network_delegate),
28 throttler_manager_(throttler_manager),
29 accept_language_(accept_language),
30 accept_charset_(accept_charset),
31 cookie_store_(cookie_store),
32 fraudulent_certificate_reporter_(fraudulent_certificate_reporter),
33 ssl_config_service_(ssl_config_service),
34 transport_security_state_(transport_security_state) {
35 }
36
37 URLRequestJob* HttpProtocolHandler::MaybeCreateJob(
38 URLRequest* request) const {
39 if (!http_transaction_factory_) {
40 NOTREACHED() << "requires a valid context";
41 return new URLRequestErrorJob(request, ERR_INVALID_ARGUMENT);
42 }
43
44 GURL redirect_url;
45 if (request->GetHSTSRedirect(&redirect_url))
46 return new URLRequestRedirectJob(request, redirect_url);
47 return new URLRequestHttpJob(request,
48 http_transaction_factory_,
49 network_delegate_,
50 throttler_manager_,
51 accept_language_,
52 accept_charset_,
53 cookie_store_,
54 fraudulent_certificate_reporter_,
55 ssl_config_service_,
56 transport_security_state_);
57 }
58
59 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698