diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 01:29:29 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-02 01:29:29 +0000 |
commit | e3448ea27e38817f78ea1a4678831fb507a6d1c9 (patch) | |
tree | 464ad655ff1f1cc52710cc971bb6a240789bd40e /chrome/browser/renderer_host | |
parent | d833fa2a5d20d413834b6db5a882142a6b7f965a (diff) | |
download | chromium_src-e3448ea27e38817f78ea1a4678831fb507a6d1c9.zip chromium_src-e3448ea27e38817f78ea1a4678831fb507a6d1c9.tar.gz chromium_src-e3448ea27e38817f78ea1a4678831fb507a6d1c9.tar.bz2 |
Add Profile::DeleteSpellChecker(), which my MemoryPurger will use to purge the spellchecker objects from memory.
This reworks the SpellChecker management functions inside the ProfileImpl for simplicity. The only notable side effect is that GetSpellChecker() will now cause a notification if it inits |spellchecker_|, just like ReinitializeSpellChecker() already did. This was just to simplify the code; at the point this fires, no one will be listening yet, so it won't actually do anything.
Also use a temporary at one spot in browser_render_process_host.cc instead of calling a heavyweight function twice in a row.
BUG=23400
TEST=none
Review URL: http://codereview.chromium.org/259009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27816 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 2fbf4bf..068cda8 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -401,9 +401,10 @@ void BrowserRenderProcessHost::WidgetHidden() { void BrowserRenderProcessHost::AddWord(const std::wstring& word) { base::Thread* io_thread = g_browser_process->io_thread(); - if (profile()->GetSpellChecker()) { + SpellChecker* spellchecker = profile()->GetSpellChecker(); + if (spellchecker) { io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( - profile()->GetSpellChecker(), &SpellChecker::AddWord, word)); + spellchecker, &SpellChecker::AddWord, word)); } } |