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

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

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

Powered by Google App Engine
This is Rietveld 408576698