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

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

Issue 1422573008: Plumbing SSLPrivateKey (//net) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 "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 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 // OnAuthRequired. 1243 // OnAuthRequired.
1244 // 1244 //
1245 // We have to do this via InvokeLater to avoid "recursing" the consumer. 1245 // We have to do this via InvokeLater to avoid "recursing" the consumer.
1246 // 1246 //
1247 base::ThreadTaskRunnerHandle::Get()->PostTask( 1247 base::ThreadTaskRunnerHandle::Get()->PostTask(
1248 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted, 1248 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted,
1249 weak_factory_.GetWeakPtr(), OK)); 1249 weak_factory_.GetWeakPtr(), OK));
1250 } 1250 }
1251 1251
1252 void URLRequestHttpJob::ContinueWithCertificate( 1252 void URLRequestHttpJob::ContinueWithCertificate(
1253 X509Certificate* client_cert) { 1253 X509Certificate* client_cert,
1254 SSLPrivateKey* client_private_key) {
1254 DCHECK(transaction_.get()); 1255 DCHECK(transaction_.get());
1255 1256
1256 DCHECK(!response_info_) << "should not have a response yet"; 1257 DCHECK(!response_info_) << "should not have a response yet";
1257 receive_headers_end_ = base::TimeTicks(); 1258 receive_headers_end_ = base::TimeTicks();
1258 1259
1259 ResetTimer(); 1260 ResetTimer();
1260 1261
1261 // No matter what, we want to report our status as IO pending since we will 1262 // No matter what, we want to report our status as IO pending since we will
1262 // be notifying our consumer asynchronously via OnStartCompleted. 1263 // be notifying our consumer asynchronously via OnStartCompleted.
1263 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0)); 1264 SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
1264 1265
1265 int rv = transaction_->RestartWithCertificate(client_cert, start_callback_); 1266 int rv = transaction_->RestartWithCertificate(client_cert, client_private_key,
1267 start_callback_);
1266 if (rv == ERR_IO_PENDING) 1268 if (rv == ERR_IO_PENDING)
1267 return; 1269 return;
1268 1270
1269 // The transaction started synchronously, but we need to notify the 1271 // The transaction started synchronously, but we need to notify the
1270 // URLRequest delegate via the message loop. 1272 // URLRequest delegate via the message loop.
1271 base::ThreadTaskRunnerHandle::Get()->PostTask( 1273 base::ThreadTaskRunnerHandle::Get()->PostTask(
1272 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted, 1274 FROM_HERE, base::Bind(&URLRequestHttpJob::OnStartCompleted,
1273 weak_factory_.GetWeakPtr(), rv)); 1275 weak_factory_.GetWeakPtr(), rv));
1274 } 1276 }
1275 1277
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1561 return override_response_headers_.get() ? 1563 return override_response_headers_.get() ?
1562 override_response_headers_.get() : 1564 override_response_headers_.get() :
1563 transaction_->GetResponseInfo()->headers.get(); 1565 transaction_->GetResponseInfo()->headers.get();
1564 } 1566 }
1565 1567
1566 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1568 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1567 awaiting_callback_ = false; 1569 awaiting_callback_ = false;
1568 } 1570 }
1569 1571
1570 } // namespace net 1572 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698