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

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

Issue 8590003: chrome: Remove 11 exit time destructors and 4 static initializers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no gyp changes :-( Created 9 years, 1 month 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_impl.h" 5 #include "chrome/browser/spellchecker/spellcheck_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 FilePath dict_dir; 45 FilePath dict_dir;
46 PathService::Get(chrome::DIR_APP_DICTIONARIES, &dict_dir); 46 PathService::Get(chrome::DIR_APP_DICTIONARIES, &dict_dir);
47 return SpellCheckCommon::GetVersionedFileName(language, dict_dir); 47 return SpellCheckCommon::GetVersionedFileName(language, dict_dir);
48 } 48 }
49 49
50 #if defined(OS_MACOSX) 50 #if defined(OS_MACOSX)
51 // Collect metrics on how often Hunspell is used on OS X vs the native 51 // Collect metrics on how often Hunspell is used on OS X vs the native
52 // spellchecker. 52 // spellchecker.
53 void RecordSpellCheckStats(bool native_spellchecker_used, 53 void RecordSpellCheckStats(bool native_spellchecker_used,
54 const std::string& language) { 54 const std::string& language) {
55 static std::set<std::string> languages_seen; 55 CR_DEFINE_STATIC_LOCAL(std::set<std::string>, languages_seen, ());
56 56
57 // Only count a language code once for each session.. 57 // Only count a language code once for each session..
58 if (languages_seen.find(language) != languages_seen.end()) { 58 if (languages_seen.find(language) != languages_seen.end()) {
59 return; 59 return;
60 } 60 }
61 languages_seen.insert(language); 61 languages_seen.insert(language);
62 62
63 enum { 63 enum {
64 SPELLCHECK_OSX_NATIVE_SPELLCHECKER_USED = 0, 64 SPELLCHECK_OSX_NATIVE_SPELLCHECKER_USED = 0,
65 SPELLCHECK_HUNSPELL_USED = 1 65 SPELLCHECK_HUNSPELL_USED = 1
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 476 }
477 477
478 void SpellCheckHostImpl::AddWordComplete(const std::string& word) { 478 void SpellCheckHostImpl::AddWordComplete(const std::string& word) {
479 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 479 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
480 480
481 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); 481 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
482 !i.IsAtEnd(); i.Advance()) { 482 !i.IsAtEnd(); i.Advance()) {
483 i.GetCurrentValue()->Send(new SpellCheckMsg_WordAdded(word)); 483 i.GetCurrentValue()->Send(new SpellCheckMsg_WordAdded(word));
484 } 484 }
485 } 485 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698