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

Side by Side Diff: webkit/database/database_tracker.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 | « webkit/appcache/appcache_database.cc ('k') | webkit/quota/quota_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 "webkit/database/database_tracker.h" 5 #include "webkit/database/database_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 db_dir_.Append(base::FilePath(kTrackerDatabaseFileName)); 475 db_dir_.Append(base::FilePath(kTrackerDatabaseFileName));
476 if (file_util::DirectoryExists(db_dir_) && 476 if (file_util::DirectoryExists(db_dir_) &&
477 file_util::PathExists(kTrackerDatabaseFullPath) && 477 file_util::PathExists(kTrackerDatabaseFullPath) &&
478 (!db_->Open(kTrackerDatabaseFullPath) || 478 (!db_->Open(kTrackerDatabaseFullPath) ||
479 !sql::MetaTable::DoesTableExist(db_.get()))) { 479 !sql::MetaTable::DoesTableExist(db_.get()))) {
480 db_->Close(); 480 db_->Close();
481 if (!file_util::Delete(db_dir_, true)) 481 if (!file_util::Delete(db_dir_, true))
482 return false; 482 return false;
483 } 483 }
484 484
485 db_->set_error_histogram_name("Sqlite.DatabaseTracker.Error"); 485 db_->set_histogram_tag("DatabaseTracker");
486 486
487 databases_table_.reset(new DatabasesTable(db_.get())); 487 databases_table_.reset(new DatabasesTable(db_.get()));
488 meta_table_.reset(new sql::MetaTable()); 488 meta_table_.reset(new sql::MetaTable());
489 489
490 is_initialized_ = 490 is_initialized_ =
491 file_util::CreateDirectory(db_dir_) && 491 file_util::CreateDirectory(db_dir_) &&
492 (db_->is_open() || 492 (db_->is_open() ||
493 (is_incognito_ ? db_->OpenInMemory() : 493 (is_incognito_ ? db_->OpenInMemory() :
494 db_->Open(kTrackerDatabaseFullPath))) && 494 db_->Open(kTrackerDatabaseFullPath))) &&
495 UpgradeToCurrentVersion(); 495 UpgradeToCurrentVersion();
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 if (!db_tracker_thread_->BelongsToCurrentThread()) { 869 if (!db_tracker_thread_->BelongsToCurrentThread()) {
870 db_tracker_thread_->PostTask( 870 db_tracker_thread_->PostTask(
871 FROM_HERE, 871 FROM_HERE,
872 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this)); 872 base::Bind(&DatabaseTracker::SetForceKeepSessionState, this));
873 return; 873 return;
874 } 874 }
875 force_keep_session_state_ = true; 875 force_keep_session_state_ = true;
876 } 876 }
877 877
878 } // namespace webkit_database 878 } // namespace webkit_database
OLDNEW
« no previous file with comments | « webkit/appcache/appcache_database.cc ('k') | webkit/quota/quota_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698