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

Side by Side Diff: chrome/browser/net/sqlite_server_bound_cert_store.cc

Issue 14976003: Histogram versions and extended error codes for SQLite databases. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops - need old histograms for continuity. Created 7 years, 7 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/history/top_sites_database.cc ('k') | components/webdata/common/web_database.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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_tag("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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/history/top_sites_database.cc ('k') | components/webdata/common/web_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698