Chromium Code Reviews| Index: chrome/browser/predictors/predictor_database.cc |
| diff --git a/chrome/browser/predictors/predictor_database.cc b/chrome/browser/predictors/predictor_database.cc |
| index af6bacb857c8b0900e45c52df64775e9602da0a8..87c64527e1aaef6af7db8ccf1b1ae48e1779e493 100644 |
| --- a/chrome/browser/predictors/predictor_database.cc |
| +++ b/chrome/browser/predictors/predictor_database.cc |
| @@ -47,6 +47,7 @@ class PredictorDatabaseInternal |
| // Cancels pending DB transactions. Should only be called on the UI thread. |
| void SetCancelled(); |
| + Profile* const profile_; |
|
dominich
2012/08/30 16:07:31
caching the profile pointer is rarely the right th
Shishir
2012/08/30 17:56:42
Doesn't this make sense for a profile keyed servic
|
| FilePath db_path_; |
| sql::Connection db_; |
| @@ -60,7 +61,8 @@ class PredictorDatabaseInternal |
| PredictorDatabaseInternal::PredictorDatabaseInternal(Profile* profile) |
| - : db_path_(profile->GetPath().Append(kPredictorDatabaseName)), |
| + : profile_(profile), |
| + db_path_(profile->GetPath().Append(kPredictorDatabaseName)), |
| autocomplete_table_(new AutocompleteActionPredictorTable()), |
| resource_prefetch_tables_(new ResourcePrefetchPredictorTables()) { |
| } |
| @@ -98,8 +100,8 @@ void PredictorDatabaseInternal::LogDatabaseStats() { |
| UMA_HISTOGRAM_MEMORY_KB("PredictorDatabase.DatabaseSizeKB", |
| static_cast<int>(db_size / 1024)); |
| - autocomplete_table_->LogDatabaseStats(); |
| - resource_prefetch_tables_->LogDatabaseStats(); |
| + autocomplete_table_->LogDatabaseStats(profile_); |
| + resource_prefetch_tables_->LogDatabaseStats(profile_); |
|
dominich
2012/08/30 16:07:31
given you know what table you're calling this on,
Shishir
2012/08/30 17:56:42
Done.
|
| } |
| PredictorDatabase::PredictorDatabase(Profile* profile) |