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

Unified Diff: chrome/browser/spellcheck_host_impl.cc

Issue 6995099: Revert 88309 - Introduced additional spellcheck related histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/spellcheck_host_impl.h ('k') | content/browser/renderer_host/render_view_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/spellcheck_host_impl.cc
===================================================================
--- chrome/browser/spellcheck_host_impl.cc (revision 88455)
+++ chrome/browser/spellcheck_host_impl.cc (working copy)
@@ -91,7 +91,6 @@
request_context_getter_(request_context_getter),
misspelled_word_count_(0),
spellchecked_word_count_(0),
- suggestion_count_(0),
replaced_word_count_(0) {
DCHECK(observer_);
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -316,30 +315,16 @@
UMA_HISTOGRAM_PERCENTAGE("SpellCheck.MisspellRatio", percentage);
}
-void SpellCheckHostImpl::RecordDictionaryCorruptionStats(bool corrupted) {
- UMA_HISTOGRAM_BOOLEAN("SpellCheck.DictionaryCorrupted", corrupted);
-}
-
-void SpellCheckHostImpl::RecordSuggestionStats(int delta) {
- suggestion_count_ += delta;
- RecordReplacedWordStats(0);
-}
-
void SpellCheckHostImpl::RecordReplacedWordStats(int delta) {
replaced_word_count_ += delta;
-
- if (misspelled_word_count_) {
- // zero |misspelled_word_count_| is possible when an extension
- // gives the misspelling, which is not recorded as a part of this
- // metrics.
- int percentage = (100 * replaced_word_count_) / misspelled_word_count_;
- UMA_HISTOGRAM_PERCENTAGE("SpellCheck.ReplaceRatio", percentage);
+ if (!misspelled_word_count_) {
+ // This is possible when an extension gives the misspelling,
+ // which is not recorded as a part of this metrics.
+ return;
}
- if (suggestion_count_) {
- int percentage = (100 * replaced_word_count_) / suggestion_count_;
- UMA_HISTOGRAM_PERCENTAGE("SpellCheck.SuggestionHitRatio", percentage);
- }
+ int percentage = (100 * replaced_word_count_) / misspelled_word_count_;
+ UMA_HISTOGRAM_PERCENTAGE("SpellCheck.ReplaceRatio", percentage);
}
void SpellCheckHostImpl::OnURLFetchComplete(const URLFetcher* source,
@@ -387,9 +372,7 @@
// To prevent corrupted dictionary data from causing a renderer crash, scan
// the dictionary data and verify it is sane before save it to a file.
- bool verified = hunspell::BDict::Verify(data_.data(), data_.size());
- RecordDictionaryCorruptionStats(!verified);
- if (!verified) {
+ if (!hunspell::BDict::Verify(data_.data(), data_.size())) {
LOG(ERROR) << "Failure to verify the downloaded dictionary.";
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
« no previous file with comments | « chrome/browser/spellcheck_host_impl.h ('k') | content/browser/renderer_host/render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698