| 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 "chrome/browser/net/sqlite_server_bound_cert_store.h" | 5 #include "chrome/browser/net/sqlite_server_bound_cert_store.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 // from it. | 246 // from it. |
| 247 const base::FilePath dir = path_.DirName(); | 247 const base::FilePath dir = path_.DirName(); |
| 248 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) | 248 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) |
| 249 return; | 249 return; |
| 250 | 250 |
| 251 int64 db_size = 0; | 251 int64 db_size = 0; |
| 252 if (file_util::GetFileSize(path_, &db_size)) | 252 if (file_util::GetFileSize(path_, &db_size)) |
| 253 UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024 ); | 253 UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024 ); |
| 254 | 254 |
| 255 db_.reset(new sql::Connection); | 255 db_.reset(new sql::Connection); |
| 256 db_->set_error_histogram_name("Sqlite.DomainBoundCerts.Error"); | 256 db_->set_histogram_prefix("Sqlite.DomainBoundCerts"); |
| 257 db_->set_error_delegate(new KillDatabaseErrorDelegate(this)); | 257 db_->set_error_delegate(new KillDatabaseErrorDelegate(this)); |
| 258 | 258 |
| 259 if (!db_->Open(path_)) { | 259 if (!db_->Open(path_)) { |
| 260 NOTREACHED() << "Unable to open cert DB."; | 260 NOTREACHED() << "Unable to open cert DB."; |
| 261 if (corruption_detected_) | 261 if (corruption_detected_) |
| 262 KillDatabase(); | 262 KillDatabase(); |
| 263 db_.reset(); | 263 db_.reset(); |
| 264 return; | 264 return; |
| 265 } | 265 } |
| 266 | 266 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 | 663 |
| 664 void SQLiteServerBoundCertStore::SetForceKeepSessionState() { | 664 void SQLiteServerBoundCertStore::SetForceKeepSessionState() { |
| 665 backend_->SetForceKeepSessionState(); | 665 backend_->SetForceKeepSessionState(); |
| 666 } | 666 } |
| 667 | 667 |
| 668 SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() { | 668 SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() { |
| 669 backend_->Close(); | 669 backend_->Close(); |
| 670 // We release our reference to the Backend, though it will probably still have | 670 // We release our reference to the Backend, though it will probably still have |
| 671 // a reference if the background thread has not run Close() yet. | 671 // a reference if the background thread has not run Close() yet. |
| 672 } | 672 } |
| OLD | NEW |