diff options
author | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-09 01:11:20 +0000 |
---|---|---|
committer | morrita@chromium.org <morrita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-09 01:11:20 +0000 |
commit | 34ab461562084b37c395af0c197b86431d3df6bb (patch) | |
tree | 0f2942518e5224968f78bcb2d688ca4ad0df3498 | |
parent | 010791dcdbfb46d31846a486790650f8dc38aa5a (diff) | |
download | chromium_src-34ab461562084b37c395af0c197b86431d3df6bb.zip chromium_src-34ab461562084b37c395af0c197b86431d3df6bb.tar.gz chromium_src-34ab461562084b37c395af0c197b86431d3df6bb.tar.bz2 |
Revert 88309 - Introduced additional spellcheck related histograms.
I revert this because of the lack of appropriate review.
This change added:
- "SpellCheck.SuggestionHitRatio" (percentage)
- "SpellCheck.SuggestionHitRatio" (boolean)
TEST=manual
TBR=darin
BUG=none
Review URL: http://codereview.chromium.org/7121006
TBR=morrita@chromium.org
Review URL: http://codereview.chromium.org/6995099
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88456 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/spellcheck_host.h | 4 | ||||
-rw-r--r-- | chrome/browser/spellcheck_host_impl.cc | 31 | ||||
-rw-r--r-- | chrome/browser/spellcheck_host_impl.h | 10 | ||||
-rw-r--r-- | content/browser/renderer_host/render_view_host.cc | 7 |
4 files changed, 7 insertions, 45 deletions
diff --git a/chrome/browser/spellcheck_host.h b/chrome/browser/spellcheck_host.h index d14a849..27ccbc2 100644 --- a/chrome/browser/spellcheck_host.h +++ b/chrome/browser/spellcheck_host.h @@ -88,10 +88,6 @@ class SpellCheckHost // to be uploaded via UMA virtual void RecordCheckedWordStats(bool misspell) = 0; - // Collects a histogram for context menu showing as a spell correction - // attempt to be uploaded via UMA - virtual void RecordSuggestionStats(int delta) = 0; - // Collects a histogram for misspelled word replacement // to be uploaded via UMA virtual void RecordReplacedWordStats(int delta) = 0; diff --git a/chrome/browser/spellcheck_host_impl.cc b/chrome/browser/spellcheck_host_impl.cc index b825b98..d87d000 100644 --- a/chrome/browser/spellcheck_host_impl.cc +++ b/chrome/browser/spellcheck_host_impl.cc @@ -91,7 +91,6 @@ SpellCheckHostImpl::SpellCheckHostImpl( 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 @@ void SpellCheckHostImpl::RecordCheckedWordStats(bool misspell) { 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 @@ void SpellCheckHostImpl::SaveDictionaryData() { // 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, diff --git a/chrome/browser/spellcheck_host_impl.h b/chrome/browser/spellcheck_host_impl.h index 03e5800..dea73bc 100644 --- a/chrome/browser/spellcheck_host_impl.h +++ b/chrome/browser/spellcheck_host_impl.h @@ -87,10 +87,6 @@ class SpellCheckHostImpl : public SpellCheckHost, // Write a custom dictionary addition to disk. void WriteWordToCustomDictionary(const std::string& word); - // Collects a histogram for dictionary corruption rate - // to be uploaded via UMA - void RecordDictionaryCorruptionStats(bool corrupted); - // Collects status of spellchecking enabling state, which is // to be uploaded via UMA virtual void RecordCheckedWordStats(bool misspell); @@ -99,10 +95,6 @@ class SpellCheckHostImpl : public SpellCheckHost, // to be uploaded via UMA virtual void RecordReplacedWordStats(int delta); - // Collects a histogram for context menu showing as a spell correction - // attempt to be uploaded via UMA - virtual void RecordSuggestionStats(int delta); - // URLFetcher::Delegate implementation. Called when we finish downloading the // spellcheck dictionary; saves the dictionary to |data_|. virtual void OnURLFetchComplete(const URLFetcher* source, @@ -161,8 +153,6 @@ class SpellCheckHostImpl : public SpellCheckHost, int misspelled_word_count_; // Number of checked words. int spellchecked_word_count_; - // Number of suggestion list showings. - int suggestion_count_; // Number of misspelled words replaced by a user. int replaced_word_count_; }; diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc index 45838fe..1e91447 100644 --- a/content/browser/renderer_host/render_view_host.cc +++ b/content/browser/renderer_host/render_view_host.cc @@ -16,7 +16,6 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/spellcheck_host.h" #include "content/browser/browser_message_filter.h" #include "content/browser/child_process_security_policy.h" #include "content/browser/content_browser_client.h" @@ -961,12 +960,6 @@ void RenderViewHost::OnMsgContextMenu(const ContextMenuParams& params) { FilterURL(policy, renderer_id, &validated_params.frame_url); view->ShowContextMenu(validated_params); - - Profile* profile = process()->profile(); - DCHECK(profile); - if (!validated_params.dictionary_suggestions.empty() && - profile->GetSpellCheckHost()) - profile->GetSpellCheckHost()->RecordSuggestionStats(1); } void RenderViewHost::OnMsgOpenURL(const GURL& url, |