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_); |