summaryrefslogtreecommitdiffstats
path: root/chrome/browser/predictors/predictor_database.cc
diff options
context:
space:
mode:
authorshishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-04 23:48:28 +0000
committershishir@chromium.org <shishir@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-04 23:48:28 +0000
commitfa8cd27dc1140c066622ba75786e6f345f21bf2e (patch)
tree832322ccabfec6b1e133bc72685515067468c14b /chrome/browser/predictors/predictor_database.cc
parentc1840d83dbc4eb940d1bc83219606573ba91f50a (diff)
downloadchromium_src-fa8cd27dc1140c066622ba75786e6f345f21bf2e.zip
chromium_src-fa8cd27dc1140c066622ba75786e6f345f21bf2e.tar.gz
chromium_src-fa8cd27dc1140c066622ba75786e6f345f21bf2e.tar.bz2
Adding more histograms to ResourcePrefetchPredictor.
Review URL: https://chromiumcodereview.appspot.com/10900037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/predictors/predictor_database.cc')
-rw-r--r--chrome/browser/predictors/predictor_database.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome/browser/predictors/predictor_database.cc b/chrome/browser/predictors/predictor_database.cc
index af6bacb..cb904fc 100644
--- a/chrome/browser/predictors/predictor_database.cc
+++ b/chrome/browser/predictors/predictor_database.cc
@@ -11,6 +11,7 @@
#include "base/stringprintf.h"
#include "base/metrics/histogram.h"
#include "chrome/browser/predictors/autocomplete_action_predictor_table.h"
+#include "chrome/browser/predictors/resource_prefetch_predictor.h"
#include "chrome/browser/predictors/resource_prefetch_predictor_tables.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
@@ -47,6 +48,7 @@ class PredictorDatabaseInternal
// Cancels pending DB transactions. Should only be called on the UI thread.
void SetCancelled();
+ bool is_resource_prefetch_predictor_enabled_;
FilePath db_path_;
sql::Connection db_;
@@ -63,6 +65,8 @@ PredictorDatabaseInternal::PredictorDatabaseInternal(Profile* profile)
: db_path_(profile->GetPath().Append(kPredictorDatabaseName)),
autocomplete_table_(new AutocompleteActionPredictorTable()),
resource_prefetch_tables_(new ResourcePrefetchPredictorTables()) {
+ is_resource_prefetch_predictor_enabled_ =
+ ResourcePrefetchPredictor::IsEnabled(profile);
}
PredictorDatabaseInternal::~PredictorDatabaseInternal() {
@@ -99,7 +103,8 @@ void PredictorDatabaseInternal::LogDatabaseStats() {
static_cast<int>(db_size / 1024));
autocomplete_table_->LogDatabaseStats();
- resource_prefetch_tables_->LogDatabaseStats();
+ if (is_resource_prefetch_predictor_enabled_)
+ resource_prefetch_tables_->LogDatabaseStats();
}
PredictorDatabase::PredictorDatabase(Profile* profile)