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

Side by Side Diff: net/url_request/url_request.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.h" 5 #include "net/url_request/url_request.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 } 867 }
868 868
869 void URLRequest::CancelAuth() { 869 void URLRequest::CancelAuth() {
870 DCHECK(job_.get()); 870 DCHECK(job_.get());
871 DCHECK(job_->NeedsAuth()); 871 DCHECK(job_->NeedsAuth());
872 872
873 status_ = URLRequestStatus::FromError(ERR_IO_PENDING); 873 status_ = URLRequestStatus::FromError(ERR_IO_PENDING);
874 job_->CancelAuth(); 874 job_->CancelAuth();
875 } 875 }
876 876
877 void URLRequest::ContinueWithCertificate(X509Certificate* client_cert, 877 void URLRequest::ContinueWithCertificate(
878 SSLPrivateKey* client_private_key) { 878 scoped_refptr<X509Certificate> client_cert,
879 scoped_refptr<SSLPrivateKey> client_private_key) {
879 DCHECK(job_.get()); 880 DCHECK(job_.get());
880 881
881 // Matches the call in NotifyCertificateRequested. 882 // Matches the call in NotifyCertificateRequested.
882 OnCallToDelegateComplete(); 883 OnCallToDelegateComplete();
883 884
884 status_ = URLRequestStatus::FromError(ERR_IO_PENDING); 885 status_ = URLRequestStatus::FromError(ERR_IO_PENDING);
885 job_->ContinueWithCertificate(client_cert, client_private_key); 886 job_->ContinueWithCertificate(std::move(client_cert),
887 std::move(client_private_key));
886 } 888 }
887 889
888 void URLRequest::ContinueDespiteLastError() { 890 void URLRequest::ContinueDespiteLastError() {
889 DCHECK(job_.get()); 891 DCHECK(job_.get());
890 892
891 // Matches the call in NotifySSLCertificateError. 893 // Matches the call in NotifySSLCertificateError.
892 OnCallToDelegateComplete(); 894 OnCallToDelegateComplete();
893 895
894 status_ = URLRequestStatus::FromError(ERR_IO_PENDING); 896 status_ = URLRequestStatus::FromError(ERR_IO_PENDING);
895 job_->ContinueDespiteLastError(); 897 job_->ContinueDespiteLastError();
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 out->clear(); 1217 out->clear();
1216 } 1218 }
1217 1219
1218 void URLRequest::set_status(URLRequestStatus status) { 1220 void URLRequest::set_status(URLRequestStatus status) {
1219 DCHECK(status_.is_io_pending() || status_.is_success() || 1221 DCHECK(status_.is_io_pending() || status_.is_success() ||
1220 (!status.is_success() && !status.is_io_pending())); 1222 (!status.is_success() && !status.is_io_pending()));
1221 status_ = status; 1223 status_ = status;
1222 } 1224 }
1223 1225
1224 } // namespace net 1226 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698