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 #include "net/url_request/url_request_http_job.h" | 5 #include "net/url_request/url_request_http_job.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 } | 167 } |
168 | 168 |
169 // TODO(darin): make sure the port blocking code is not lost | 169 // TODO(darin): make sure the port blocking code is not lost |
170 // static | 170 // static |
171 URLRequestJob* URLRequestHttpJob::Factory(URLRequest* request, | 171 URLRequestJob* URLRequestHttpJob::Factory(URLRequest* request, |
172 const std::string& scheme) { | 172 const std::string& scheme) { |
173 DCHECK(scheme == "http" || scheme == "https"); | 173 DCHECK(scheme == "http" || scheme == "https"); |
174 | 174 |
175 if (!request->context()->http_transaction_factory()) { | 175 if (!request->context()->http_transaction_factory()) { |
176 NOTREACHED() << "requires a valid context"; | 176 NOTREACHED() << "requires a valid context"; |
177 return new URLRequestErrorJob(request, ERR_INVALID_ARGUMENT); | 177 return new URLRequestErrorJob( |
| 178 request, request->context()->network_delegate(), ERR_INVALID_ARGUMENT); |
178 } | 179 } |
179 | 180 |
180 GURL redirect_url; | 181 GURL redirect_url; |
181 if (request->GetHSTSRedirect(&redirect_url)) | 182 if (request->GetHSTSRedirect(&redirect_url)) |
182 return new URLRequestRedirectJob(request, redirect_url); | 183 return new URLRequestRedirectJob(request, redirect_url); |
183 return new URLRequestHttpJob(request); | 184 return new URLRequestHttpJob(request); |
184 } | 185 } |
185 | 186 |
186 | 187 |
187 URLRequestHttpJob::URLRequestHttpJob(URLRequest* request) | 188 URLRequestHttpJob::URLRequestHttpJob(URLRequest* request) |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 | 1468 |
1468 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1469 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1469 awaiting_callback_ = false; | 1470 awaiting_callback_ = false; |
1470 } | 1471 } |
1471 | 1472 |
1472 void URLRequestHttpJob::OnDetachRequest() { | 1473 void URLRequestHttpJob::OnDetachRequest() { |
1473 http_transaction_delegate_->OnDetachRequest(); | 1474 http_transaction_delegate_->OnDetachRequest(); |
1474 } | 1475 } |
1475 | 1476 |
1476 } // namespace net | 1477 } // namespace net |
OLD | NEW |