| 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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 // OnAuthRequired. | 1247 // OnAuthRequired. |
| 1248 // | 1248 // |
| 1249 // We have to do this via InvokeLater to avoid "recursing" the consumer. | 1249 // We have to do this via InvokeLater to avoid "recursing" the consumer. |
| 1250 // | 1250 // |
| 1251 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1251 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1252 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted, | 1252 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted, |
| 1253 weak_factory_.GetWeakPtr(), OK)); | 1253 weak_factory_.GetWeakPtr(), OK)); |
| 1254 } | 1254 } |
| 1255 | 1255 |
| 1256 void URLRequestHttpJob::ContinueWithCertificate( | 1256 void URLRequestHttpJob::ContinueWithCertificate( |
| 1257 X509Certificate* client_cert) { | 1257 X509Certificate* client_cert, |
| 1258 SSLPrivateKey* client_private_key) { |
| 1258 DCHECK(transaction_.get()); | 1259 DCHECK(transaction_.get()); |
| 1259 | 1260 |
| 1260 DCHECK(!response_info_) << "should not have a response yet"; | 1261 DCHECK(!response_info_) << "should not have a response yet"; |
| 1261 receive_headers_end_ = base::TimeTicks(); | 1262 receive_headers_end_ = base::TimeTicks(); |
| 1262 | 1263 |
| 1263 ResetTimer(); | 1264 ResetTimer(); |
| 1264 | 1265 |
| 1265 // No matter what, we want to report our status as IO pending since we will | 1266 // No matter what, we want to report our status as IO pending since we will |
| 1266 // be notifying our consumer asynchronously via OnStartCompleted. | 1267 // be notifying our consumer asynchronously via OnStartCompleted. |
| 1267 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); | 1268 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); |
| 1268 | 1269 |
| 1269 int rv = transaction_->RestartWithCertificate(client_cert, start_callback_); | 1270 int rv = transaction_->RestartWithCertificate(client_cert, client_private_key, |
| 1271 start_callback_); |
| 1270 if (rv == ERR_IO_PENDING) | 1272 if (rv == ERR_IO_PENDING) |
| 1271 return; | 1273 return; |
| 1272 | 1274 |
| 1273 // The transaction started synchronously, but we need to notify the | 1275 // The transaction started synchronously, but we need to notify the |
| 1274 // URLRequest delegate via the message loop. | 1276 // URLRequest delegate via the message loop. |
| 1275 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1277 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1276 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted, | 1278 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted, |
| 1277 weak_factory_.GetWeakPtr(), rv)); | 1279 weak_factory_.GetWeakPtr(), rv)); |
| 1278 } | 1280 } |
| 1279 | 1281 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 return override_response_headers_.get() ? | 1577 return override_response_headers_.get() ? |
| 1576 override_response_headers_.get() : | 1578 override_response_headers_.get() : |
| 1577 transaction_->GetResponseInfo()->headers.get(); | 1579 transaction_->GetResponseInfo()->headers.get(); |
| 1578 } | 1580 } |
| 1579 | 1581 |
| 1580 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1582 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1581 awaiting_callback_ = false; | 1583 awaiting_callback_ = false; |
| 1582 } | 1584 } |
| 1583 | 1585 |
| 1584 } // namespace net | 1586 } // namespace net |
| OLD | NEW |