summaryrefslogtreecommitdiffstats
path: root/chrome/browser/metrics
diff options
context:
space:
mode:
authorbartn@chromium.org <bartn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 09:42:39 +0000
committerbartn@chromium.org <bartn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-13 09:42:39 +0000
commit9d58e3df5db2c3de7110214093fe2b2fe21fb9d4 (patch)
tree72104afffbfbdb2db45ecad6c70fe5691704df3b /chrome/browser/metrics
parent0a0ddd354dbcbcc5df4e39cb13d502a6c529903c (diff)
downloadchromium_src-9d58e3df5db2c3de7110214093fe2b2fe21fb9d4.zip
chromium_src-9d58e3df5db2c3de7110214093fe2b2fe21fb9d4.tar.gz
chromium_src-9d58e3df5db2c3de7110214093fe2b2fe21fb9d4.tar.bz2
Do not set completed_length to 0 if not available.
BUG=159493 TBR=isherman@chromium.org Review URL: https://chromiumcodereview.appspot.com/11365118 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167343 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/metrics')
-rw-r--r--chrome/browser/metrics/metrics_log.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index a664db0..9ff3957 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -933,7 +933,8 @@ void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) {
WriteIntAttribute("numterms", num_terms);
WriteIntAttribute("selectedindex", static_cast<int>(log.selected_index));
WriteIntAttribute("completedlength",
- static_cast<int>(log.inline_autocompleted_length));
+ log.inline_autocompleted_length != string16::npos ?
+ static_cast<int>(log.inline_autocompleted_length) : 0);
if (log.elapsed_time_since_user_first_modified_omnibox !=
base::TimeDelta::FromMilliseconds(-1)) {
// Only upload the typing duration if it is set/valid.
@@ -969,7 +970,8 @@ void MetricsLog::RecordOmniboxOpenedURL(const AutocompleteLog& log) {
omnibox_event->set_just_deleted_text(log.just_deleted_text);
omnibox_event->set_num_typed_terms(num_terms);
omnibox_event->set_selected_index(log.selected_index);
- omnibox_event->set_completed_length(log.inline_autocompleted_length);
+ if (log.inline_autocompleted_length != string16::npos)
+ omnibox_event->set_completed_length(log.inline_autocompleted_length);
if (log.elapsed_time_since_user_first_modified_omnibox !=
base::TimeDelta::FromMilliseconds(-1)) {
// Only upload the typing duration if it is set/valid.