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

Unified Diff: chrome/browser/extensions/activity_database.cc

Issue 12207060: Alter the ActivityLog db table schemas. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: trying the upload again Created 7 years, 10 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/extensions/activity_database.cc
===================================================================
--- chrome/browser/extensions/activity_database.cc (revision 182082)
+++ chrome/browser/extensions/activity_database.cc (working copy)
@@ -51,8 +51,7 @@
db_.Preload();
// Create the UrlAction database.
- if (InitializeTable(UrlAction::kTableName, UrlAction::kTableStructure) !=
- sql::INIT_OK)
+ if (!DOMAction::InitializeTable(&db_))
return LogInitFailure();
// Create the APIAction database.
@@ -60,8 +59,7 @@
return LogInitFailure();
// Create the BlockedAction database.
- if (InitializeTable(BlockedAction::kTableName, BlockedAction::kTableStructure)
- != sql::INIT_OK)
+ if (!BlockedAction::InitializeTable(&db_))
return LogInitFailure();
sql::InitStatus stat = committer.Commit() ? sql::INIT_OK : sql::INIT_FAILURE;
@@ -75,19 +73,6 @@
LOG(ERROR) << "Couldn't initialize the activity log database.";
}
-sql::InitStatus ActivityDatabase::InitializeTable(const char* table_name,
- const char* table_structure) {
- if (!db_.DoesTableExist(table_name)) {
- char table_creator[1000];
- base::snprintf(table_creator,
- arraysize(table_creator),
- "CREATE TABLE %s %s", table_name, table_structure);
- if (!db_.Execute(table_creator))
- return sql::INIT_FAILURE;
- }
- return sql::INIT_OK;
-}
-
void ActivityDatabase::RecordAction(scoped_refptr<Action> action) {
if (initialized_)
action->Record(&db_);
« no previous file with comments | « chrome/browser/extensions/activity_database.h ('k') | chrome/browser/extensions/activity_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698