| Index: chrome/browser/extensions/activity_log/activity_database.h
|
| diff --git a/chrome/browser/extensions/activity_log/activity_database.h b/chrome/browser/extensions/activity_log/activity_database.h
|
| index f7472e905a7fb2afc217e9156584be95d546a156..6724fefe7516f10276ebe63230920fd6a8c83f1e 100644
|
| --- a/chrome/browser/extensions/activity_log/activity_database.h
|
| +++ b/chrome/browser/extensions/activity_log/activity_database.h
|
| @@ -93,20 +93,9 @@ class ActivityDatabase {
|
| // update the database schema if needed.
|
| void Init(const base::FilePath& db_name);
|
|
|
| - // The ActivityLog should call this to kill the ActivityDatabase.
|
| + // An ActivityLogPolicy should call this to kill the ActivityDatabase.
|
| void Close();
|
|
|
| - void LogInitFailure();
|
| -
|
| - // Record a DOMction in the database.
|
| - void RecordDOMAction(scoped_refptr<DOMAction> action);
|
| -
|
| - // Record a APIAction in the database.
|
| - void RecordAPIAction(scoped_refptr<APIAction> action);
|
| -
|
| - // Record a BlockedAction in the database.
|
| - void RecordBlockedAction(scoped_refptr<BlockedAction> action);
|
| -
|
| // Record an Action in the database.
|
| void RecordAction(scoped_refptr<Action> action);
|
|
|
| @@ -126,20 +115,30 @@ class ActivityDatabase {
|
| void SetClockForTesting(base::Clock* clock);
|
| void SetTimerForTesting(int milliseconds);
|
|
|
| + // A helper method for initializing or upgrading a database table. The
|
| + // content_fields array should list the names of all of the columns in the
|
| + // database. The field_types should specify the types of the corresponding
|
| + // columns (e.g., INTEGER or LONGVARCHAR). There should be the same number of
|
| + // field_types as content_fields, since the two arrays should correspond.
|
| + static bool InitializeTable(sql::Connection* db,
|
| + const char* table_name,
|
| + const char* content_fields[],
|
| + const char* field_types[],
|
| + const int num_content_fields);
|
| +
|
| private:
|
| // This should never be invoked by another class. Use Close() to order a
|
| // suicide.
|
| virtual ~ActivityDatabase();
|
|
|
| - sql::InitStatus InitializeTable(const char* table_name,
|
| - const char* table_structure);
|
| -
|
| // When we're in batched mode (which is on by default), we write to the db
|
| // every X minutes instead of on every API call. This prevents the annoyance
|
| // of writing to disk multiple times a second.
|
| void StartTimer();
|
| void RecordBatchedActions();
|
|
|
| + void LogInitFailure();
|
| +
|
| // If an error is unrecoverable or occurred while we were trying to close
|
| // the database properly, we take "emergency" actions: break any outstanding
|
| // transactions, raze the database, and close. When next opened, the
|
|
|