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

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: excess include. 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
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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 db_dir_.Append(base::FilePath(kTrackerDatabaseFileName)); 474 db_dir_.Append(base::FilePath(kTrackerDatabaseFileName));
475 if (file_util::DirectoryExists(db_dir_) && 475 if (file_util::DirectoryExists(db_dir_) &&
476 file_util::PathExists(kTrackerDatabaseFullPath) && 476 file_util::PathExists(kTrackerDatabaseFullPath) &&
477 (!db_->Open(kTrackerDatabaseFullPath) || 477 (!db_->Open(kTrackerDatabaseFullPath) ||
478 !sql::MetaTable::DoesTableExist(db_.get()))) { 478 !sql::MetaTable::DoesTableExist(db_.get()))) {
479 db_->Close(); 479 db_->Close();
480 if (!file_util::Delete(db_dir_, true)) 480 if (!file_util::Delete(db_dir_, true))
481 return false; 481 return false;
482 } 482 }
483 483
484 db_->set_error_histogram_name("Sqlite.DatabaseTracker.Error"); 484 db_->set_histogram_prefix("Sqlite.DatabaseTracker");
485 485
486 databases_table_.reset(new DatabasesTable(db_.get())); 486 databases_table_.reset(new DatabasesTable(db_.get()));
487 meta_table_.reset(new sql::MetaTable()); 487 meta_table_.reset(new sql::MetaTable());
488 488
489 is_initialized_ = 489 is_initialized_ =
490 file_util::CreateDirectory(db_dir_) && 490 file_util::CreateDirectory(db_dir_) &&
491 (db_->is_open() || 491 (db_->is_open() ||
492 (is_incognito_ ? db_->OpenInMemory() : 492 (is_incognito_ ? db_->OpenInMemory() :
493 db_->Open(kTrackerDatabaseFullPath))) && 493 db_->Open(kTrackerDatabaseFullPath))) &&
494 UpgradeToCurrentVersion(); 494 UpgradeToCurrentVersion();
(...skipping 374 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

Powered by Google App Engine
This is Rietveld 408576698