Chromium Code Reviews| Index: chrome/browser/predictors/resource_prefetch_predictor_tables.cc |
| diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables.cc b/chrome/browser/predictors/resource_prefetch_predictor_tables.cc |
| index 914c439986432fd10ed23a25279d0171969c6d01..d9caf3abadf8b2e761dde7f515a29ec41e4c5edc 100644 |
| --- a/chrome/browser/predictors/resource_prefetch_predictor_tables.cc |
| +++ b/chrome/browser/predictors/resource_prefetch_predictor_tables.cc |
| @@ -7,6 +7,7 @@ |
| #include "base/logging.h" |
| #include "base/metrics/histogram.h" |
| #include "base/stringprintf.h" |
| +#include "chrome/browser/predictors/resource_prefetch_predictor.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "sql/statement.h" |
| @@ -244,17 +245,21 @@ void ResourcePrefetchPredictorTables::CreateTableIfNonExistent() { |
| ResetDB(); |
| } |
| -void ResourcePrefetchPredictorTables::LogDatabaseStats() { |
| +void ResourcePrefetchPredictorTables::LogDatabaseStats(Profile* profile) { |
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| + |
| + if (!ResourcePrefetchPredictor::IsEnabled(profile)) |
|
dominich
2012/08/29 22:29:29
you could have it always enabled for data tracking
Shishir
2012/08/29 22:51:06
The problem is that I get a lot of empty databases
dominich
2012/08/29 23:16:49
Instead of passing down the profile, can you call
Shishir
2012/08/30 03:58:36
I could do that, but the PredictorDatabase know ab
|
| + return; |
| + |
| if (CantAccessDatabase()) |
| return; |
| - sql::Statement url_statement(DB()->GetUniqueStatement( |
| + sql::Statement total_rows_statement(DB()->GetUniqueStatement( |
| base::StringPrintf("SELECT count(*) FROM %s", |
| kResourcePredictorUrlTableName).c_str())); |
| - if (url_statement.Step()) |
| + if (total_rows_statement.Step()) |
| UMA_HISTOGRAM_COUNTS("ResourcePrefetchPredictor.UrlTableRowCount", |
| - url_statement.ColumnInt(0)); |
| + total_rows_statement.ColumnInt(0)); |
| } |
| } // namespace predictors |