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/ssl/server_bound_cert_service.h" | 5 #include "net/ssl/server_bound_cert_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
509 } | 509 } |
510 | 510 |
511 if (err == OK) { | 511 if (err == OK) { |
512 // Async DB lookup found a valid cert. | 512 // Async DB lookup found a valid cert. |
513 DVLOG(1) << "Cert store had valid cert for " << server_identifier; | 513 DVLOG(1) << "Cert store had valid cert for " << server_identifier; |
514 cert_store_hits_++; | 514 cert_store_hits_++; |
515 // ServerBoundCertServiceRequest::Post will do the histograms and stuff. | 515 // ServerBoundCertServiceRequest::Post will do the histograms and stuff. |
516 HandleResult(OK, server_identifier, key, cert); | 516 HandleResult(OK, server_identifier, key, cert); |
517 return; | 517 return; |
518 } | 518 } |
519 // Async lookup did not find a valid cert. If no request asked to create one, | 519 // Async lookup failed. If lookup gave an error or failed to find a valid cert |
wtc
2014/06/19 22:00:11
What does "lookup gave an error" mean? It seems to
davidben
2014/06/19 22:36:38
Oh yeah, I meant to explain this here. Yeah, ERR_F
| |
520 // return the error directly. | 520 // and no request asked to create one, return the error directly. |
521 if (!j->second->CreateIfMissing()) { | 521 if (err != ERR_FILE_NOT_FOUND || !j->second->CreateIfMissing()) { |
522 HandleResult(err, server_identifier, key, cert); | 522 HandleResult(err, server_identifier, key, cert); |
523 return; | 523 return; |
524 } | 524 } |
525 // At least one request asked to create a cert => start generating a new one. | 525 // At least one request asked to create a cert => start generating a new one. |
526 workers_created_++; | 526 workers_created_++; |
527 ServerBoundCertServiceWorker* worker = new ServerBoundCertServiceWorker( | 527 ServerBoundCertServiceWorker* worker = new ServerBoundCertServiceWorker( |
528 server_identifier, | 528 server_identifier, |
529 base::Bind(&ServerBoundCertService::GeneratedServerBoundCert, | 529 base::Bind(&ServerBoundCertService::GeneratedServerBoundCert, |
530 weak_ptr_factory_.GetWeakPtr())); | 530 weak_ptr_factory_.GetWeakPtr())); |
531 if (!worker->Start(task_runner_)) { | 531 if (!worker->Start(task_runner_)) { |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
667 } | 667 } |
668 | 668 |
669 return err; | 669 return err; |
670 } | 670 } |
671 | 671 |
672 int ServerBoundCertService::cert_count() { | 672 int ServerBoundCertService::cert_count() { |
673 return server_bound_cert_store_->GetCertCount(); | 673 return server_bound_cert_store_->GetCertCount(); |
674 } | 674 } |
675 | 675 |
676 } // namespace net | 676 } // namespace net |
OLD | NEW |