Chromium Code Reviews| Index: chrome/renderer/spellchecker/spellcheck.cc |
| diff --git a/chrome/renderer/spellchecker/spellcheck.cc b/chrome/renderer/spellchecker/spellcheck.cc |
| index c9e3405735b4013ad60678857f48df5b7e80b73b..86d0e1907536d60f1245f4b2579a3147c9643b41 100644 |
| --- a/chrome/renderer/spellchecker/spellcheck.cc |
| +++ b/chrome/renderer/spellchecker/spellcheck.cc |
| @@ -11,15 +11,17 @@ |
| #include "chrome/common/render_messages.h" |
| #include "chrome/common/spellcheck_common.h" |
| #include "chrome/common/spellcheck_messages.h" |
| +#include "chrome/renderer/chrome_content_renderer_client.h" |
| #include "third_party/hunspell/src/hunspell/hunspell.hxx" |
| using base::TimeTicks; |
| -SpellCheck::SpellCheck() |
| +SpellCheck::SpellCheck(chrome::ChromeContentRendererClient* renderer_client) |
| : file_(base::kInvalidPlatformFileValue), |
| auto_spell_correct_turned_on_(false), |
| is_using_platform_spelling_engine_(false), |
| - initialized_(false) { |
| + initialized_(false), |
| + renderer_client_(renderer_client) { |
| // Wait till we check the first word before doing any initializing. |
| } |
| @@ -37,8 +39,9 @@ bool SpellCheck::OnControlMessageReceived(const IPC::Message& message) { |
| IPC_END_MESSAGE_MAP() |
| if (message.type() == ViewMsg_PurgeMemory::ID) { |
| - delete this; |
| - new SpellCheck(); |
| + if (renderer_client_) { |
|
jam
2011/06/21 22:59:39
ditto
Greg Billock
2011/06/22 15:58:35
Done.
|
| + renderer_client_->ResetSpellCheck(); |
| + } |
| } |
| return handled; |