Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: chrome/browser/spellchecker/spellcheck_host_metrics.cc

Issue 113403006: Update some uses of char16 to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/spellchecker/spellcheck_host_metrics.h" 5 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h"
6 6
7 #include "base/md5.h" 7 #include "base/md5.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 9
10 SpellCheckHostMetrics::SpellCheckHostMetrics() 10 SpellCheckHostMetrics::SpellCheckHostMetrics()
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 if (misspelled_word_count_ == 1) 53 if (misspelled_word_count_ == 1)
54 RecordReplacedWordStats(0); 54 RecordReplacedWordStats(0);
55 } 55 }
56 56
57 int percentage = (100 * misspelled_word_count_) / spellchecked_word_count_; 57 int percentage = (100 * misspelled_word_count_) / spellchecked_word_count_;
58 UMA_HISTOGRAM_PERCENTAGE("SpellCheck.MisspellRatio", percentage); 58 UMA_HISTOGRAM_PERCENTAGE("SpellCheck.MisspellRatio", percentage);
59 59
60 // Collects actual number of checked words, excluding duplication. 60 // Collects actual number of checked words, excluding duplication.
61 base::MD5Digest digest; 61 base::MD5Digest digest;
62 base::MD5Sum(reinterpret_cast<const unsigned char*>(word.c_str()), 62 base::MD5Sum(reinterpret_cast<const unsigned char*>(word.c_str()),
63 word.size() * sizeof(char16), &digest); 63 word.size() * sizeof(base::char16), &digest);
64 checked_word_hashes_.insert(base::MD5DigestToBase16(digest)); 64 checked_word_hashes_.insert(base::MD5DigestToBase16(digest));
65 65
66 RecordWordCounts(); 66 RecordWordCounts();
67 } 67 }
68 68
69 void SpellCheckHostMetrics::OnHistogramTimerExpired() { 69 void SpellCheckHostMetrics::OnHistogramTimerExpired() {
70 if (0 < spellchecked_word_count_) { 70 if (0 < spellchecked_word_count_) {
71 // Collects word checking rate, which is represented 71 // Collects word checking rate, which is represented
72 // as a word count per hour. 72 // as a word count per hour.
73 base::TimeDelta since_start = base::TimeTicks::Now() - start_time_; 73 base::TimeDelta since_start = base::TimeTicks::Now() - start_time_;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (suggestion_show_count_ != last_suggestion_show_count_) { 138 if (suggestion_show_count_ != last_suggestion_show_count_) {
139 DCHECK(suggestion_show_count_ > last_suggestion_show_count_); 139 DCHECK(suggestion_show_count_ > last_suggestion_show_count_);
140 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); 140 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_);
141 last_suggestion_show_count_ = suggestion_show_count_; 141 last_suggestion_show_count_ = suggestion_show_count_;
142 } 142 }
143 } 143 }
144 144
145 void SpellCheckHostMetrics::RecordSpellingServiceStats(bool enabled) { 145 void SpellCheckHostMetrics::RecordSpellingServiceStats(bool enabled) {
146 UMA_HISTOGRAM_BOOLEAN("SpellCheck.SpellingService.Enabled", enabled); 146 UMA_HISTOGRAM_BOOLEAN("SpellCheck.SpellingService.Enabled", enabled);
147 } 147 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_shortcut_manager_win.cc ('k') | chrome/browser/storage_monitor/portable_device_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698