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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
194 | 194 |
195 // This method should be called only once per instance. | 195 // This method should be called only once per instance. |
196 DCHECK(!db_.get()); | 196 DCHECK(!db_.get()); |
197 | 197 |
198 base::TimeTicks start = base::TimeTicks::Now(); | 198 base::TimeTicks start = base::TimeTicks::Now(); |
199 | 199 |
200 // Ensure the parent directory for storing certs is created before reading | 200 // Ensure the parent directory for storing certs is created before reading |
201 // from it. | 201 // from it. |
202 const base::FilePath dir = path_.DirName(); | 202 const base::FilePath dir = path_.DirName(); |
203 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) | 203 if (!base::PathExists(dir) && !file_util::CreateDirectory(dir)) |
204 return; | 204 return; |
205 | 205 |
206 int64 db_size = 0; | 206 int64 db_size = 0; |
207 if (file_util::GetFileSize(path_, &db_size)) | 207 if (file_util::GetFileSize(path_, &db_size)) |
208 UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024 ); | 208 UMA_HISTOGRAM_COUNTS("DomainBoundCerts.DBSizeInKB", db_size / 1024 ); |
209 | 209 |
210 db_.reset(new sql::Connection); | 210 db_.reset(new sql::Connection); |
211 db_->set_histogram_tag("DomainBoundCerts"); | 211 db_->set_histogram_tag("DomainBoundCerts"); |
212 | 212 |
213 // Unretained to avoid a ref loop with db_. | 213 // Unretained to avoid a ref loop with db_. |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 | 633 |
634 void SQLiteServerBoundCertStore::SetForceKeepSessionState() { | 634 void SQLiteServerBoundCertStore::SetForceKeepSessionState() { |
635 backend_->SetForceKeepSessionState(); | 635 backend_->SetForceKeepSessionState(); |
636 } | 636 } |
637 | 637 |
638 SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() { | 638 SQLiteServerBoundCertStore::~SQLiteServerBoundCertStore() { |
639 backend_->Close(); | 639 backend_->Close(); |
640 // We release our reference to the Backend, though it will probably still have | 640 // We release our reference to the Backend, though it will probably still have |
641 // a reference if the background thread has not run Close() yet. | 641 // a reference if the background thread has not run Close() yet. |
642 } | 642 } |
OLD | NEW |