OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/predictors/autocomplete_action_predictor_table.h" | 5 #include "chrome/browser/predictors/autocomplete_action_predictor_table.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram_macros.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "sql/statement.h" | 15 #include "sql/statement.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 // TODO(shishir): Rename the table for consistency. | 19 // TODO(shishir): Rename the table for consistency. |
20 const char kAutocompletePredictorTableName[] = "network_action_predictor"; | 20 const char kAutocompletePredictorTableName[] = "network_action_predictor"; |
21 | 21 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 sql::Statement count_statement(DB()->GetUniqueStatement( | 253 sql::Statement count_statement(DB()->GetUniqueStatement( |
254 base::StringPrintf("SELECT count(id) FROM %s", | 254 base::StringPrintf("SELECT count(id) FROM %s", |
255 kAutocompletePredictorTableName).c_str())); | 255 kAutocompletePredictorTableName).c_str())); |
256 if (!count_statement.is_valid() || !count_statement.Step()) | 256 if (!count_statement.is_valid() || !count_statement.Step()) |
257 return; | 257 return; |
258 UMA_HISTOGRAM_COUNTS("AutocompleteActionPredictor.DatabaseRowCount", | 258 UMA_HISTOGRAM_COUNTS("AutocompleteActionPredictor.DatabaseRowCount", |
259 count_statement.ColumnInt(0)); | 259 count_statement.ColumnInt(0)); |
260 } | 260 } |
261 | 261 |
262 } // namespace predictors | 262 } // namespace predictors |
OLD | NEW |