| 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))
|
| + 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
|
|
|