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

Unified Diff: chrome/browser/history/download_database.cc

Issue 9592026: Create meta table atomically. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/download_database.cc
diff --git a/chrome/browser/history/download_database.cc b/chrome/browser/history/download_database.cc
index d47d72dd8dc3f71245a4c63081d7795c0626cf07..eb4a0aece4da92e869b067e84ab64a54461841a3 100644
--- a/chrome/browser/history/download_database.cc
+++ b/chrome/browser/history/download_database.cc
@@ -103,9 +103,7 @@ bool DownloadDatabase::EnsureColumnExists(
bool DownloadDatabase::InitDownloadTable() {
CheckThread();
- bool success = meta_table_.Init(&GetDB(), 0, 0);
- DCHECK(success);
- meta_table_.GetValue(kNextDownloadId, &next_id_);
+ GetMetaTable().GetValue(kNextDownloadId, &next_id_);
if (GetDB().DoesTableExist("downloads")) {
return EnsureColumnExists("end_time", "INTEGER NOT NULL DEFAULT 0") &&
EnsureColumnExists("opened", "INTEGER NOT NULL DEFAULT 0");
@@ -224,7 +222,7 @@ int64 DownloadDatabase::CreateDownload(
if (statement.Run()) {
// TODO(benjhayden) if(info.id>next_id_){setvalue;next_id_=info.id;}
- meta_table_.SetValue(kNextDownloadId, ++next_id_);
+ GetMetaTable().SetValue(kNextDownloadId, ++next_id_);
return db_handle;
}

Powered by Google App Engine
This is Rietveld 408576698