| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 // Running the callback might delete |this|, so we can't touch any of our | 364 // Running the callback might delete |this|, so we can't touch any of our |
| 365 // members afterwards. Reset callback_ first. | 365 // members afterwards. Reset callback_ first. |
| 366 base::ResetAndReturn(&callback_).Run(result); | 366 base::ResetAndReturn(&callback_).Run(result); |
| 367 } | 367 } |
| 368 | 368 |
| 369 ServerBoundCertService::ServerBoundCertService( | 369 ServerBoundCertService::ServerBoundCertService( |
| 370 ServerBoundCertStore* server_bound_cert_store, | 370 ServerBoundCertStore* server_bound_cert_store, |
| 371 const scoped_refptr<base::TaskRunner>& task_runner) | 371 const scoped_refptr<base::TaskRunner>& task_runner) |
| 372 : server_bound_cert_store_(server_bound_cert_store), | 372 : server_bound_cert_store_(server_bound_cert_store), |
| 373 task_runner_(task_runner), | 373 task_runner_(task_runner), |
| 374 weak_ptr_factory_(this), |
| 374 requests_(0), | 375 requests_(0), |
| 375 cert_store_hits_(0), | 376 cert_store_hits_(0), |
| 376 inflight_joins_(0), | 377 inflight_joins_(0), |
| 377 workers_created_(0), | 378 workers_created_(0) { |
| 378 weak_ptr_factory_(this) { | |
| 379 base::Time start = base::Time::Now(); | 379 base::Time start = base::Time::Now(); |
| 380 base::Time end = start + base::TimeDelta::FromDays( | 380 base::Time end = start + base::TimeDelta::FromDays( |
| 381 kValidityPeriodInDays + kSystemTimeValidityBufferInDays); | 381 kValidityPeriodInDays + kSystemTimeValidityBufferInDays); |
| 382 is_system_time_valid_ = x509_util::IsSupportedValidityRange(start, end); | 382 is_system_time_valid_ = x509_util::IsSupportedValidityRange(start, end); |
| 383 } | 383 } |
| 384 | 384 |
| 385 ServerBoundCertService::~ServerBoundCertService() { | 385 ServerBoundCertService::~ServerBoundCertService() { |
| 386 STLDeleteValues(&inflight_); | 386 STLDeleteValues(&inflight_); |
| 387 } | 387 } |
| 388 | 388 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 } | 669 } |
| 670 | 670 |
| 671 return err; | 671 return err; |
| 672 } | 672 } |
| 673 | 673 |
| 674 int ServerBoundCertService::cert_count() { | 674 int ServerBoundCertService::cert_count() { |
| 675 return server_bound_cert_store_->GetCertCount(); | 675 return server_bound_cert_store_->GetCertCount(); |
| 676 } | 676 } |
| 677 | 677 |
| 678 } // namespace net | 678 } // namespace net |
| OLD | NEW |