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

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

Issue 2898573002: Refactor client cert private key handling. (Closed)
Patch Set: . Created 3 years, 6 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
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 #include "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1255 // OnAuthRequired. 1255 // OnAuthRequired.
1256 // 1256 //
1257 // We have to do this via InvokeLater to avoid "recursing" the consumer. 1257 // We have to do this via InvokeLater to avoid "recursing" the consumer.
1258 // 1258 //
1259 base::ThreadTaskRunnerHandle::Get()->PostTask( 1259 base::ThreadTaskRunnerHandle::Get()->PostTask(
1260 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted, 1260 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted,
1261 weak_factory_.GetWeakPtr(), OK)); 1261 weak_factory_.GetWeakPtr(), OK));
1262 } 1262 }
1263 1263
1264 void URLRequestHttpJob::ContinueWithCertificate( 1264 void URLRequestHttpJob::ContinueWithCertificate(
1265 X509Certificate* client_cert, 1265 scoped_refptr<X509Certificate> client_cert,
1266 SSLPrivateKey* client_private_key) { 1266 scoped_refptr<SSLPrivateKey> client_private_key) {
1267 DCHECK(transaction_.get()); 1267 DCHECK(transaction_.get());
1268 1268
1269 DCHECK(!response_info_) << "should not have a response yet"; 1269 DCHECK(!response_info_) << "should not have a response yet";
1270 receive_headers_end_ = base::TimeTicks(); 1270 receive_headers_end_ = base::TimeTicks();
1271 1271
1272 ResetTimer(); 1272 ResetTimer();
1273 1273
1274 int rv = transaction_->RestartWithCertificate( 1274 int rv = transaction_->RestartWithCertificate(
1275 client_cert, client_private_key, 1275 std::move(client_cert), std::move(client_private_key),
1276 base::Bind(&URLRequestHttpJob::OnStartCompleted, base::Unretained(this))); 1276 base::Bind(&URLRequestHttpJob::OnStartCompleted, base::Unretained(this)));
1277 if (rv == ERR_IO_PENDING) 1277 if (rv == ERR_IO_PENDING)
1278 return; 1278 return;
1279 1279
1280 // The transaction started synchronously, but we need to notify the 1280 // The transaction started synchronously, but we need to notify the
1281 // URLRequest delegate via the message loop. 1281 // URLRequest delegate via the message loop.
1282 base::ThreadTaskRunnerHandle::Get()->PostTask( 1282 base::ThreadTaskRunnerHandle::Get()->PostTask(
1283 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted, 1283 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted,
1284 weak_factory_.GetWeakPtr(), rv)); 1284 weak_factory_.GetWeakPtr(), rv));
1285 } 1285 }
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1574 awaiting_callback_ = false; 1574 awaiting_callback_ = false;
1575 1575
1576 // Notify NetworkQualityEstimator. 1576 // Notify NetworkQualityEstimator.
1577 NetworkQualityEstimator* network_quality_estimator = 1577 NetworkQualityEstimator* network_quality_estimator =
1578 request()->context()->network_quality_estimator(); 1578 request()->context()->network_quality_estimator();
1579 if (network_quality_estimator) 1579 if (network_quality_estimator)
1580 network_quality_estimator->NotifyURLRequestDestroyed(*request()); 1580 network_quality_estimator->NotifyURLRequestDestroyed(*request());
1581 } 1581 }
1582 1582
1583 } // namespace net 1583 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698