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

Unified Diff: chrome/renderer/spellchecker/spellcheck.cc

Issue 7222023: Forward handling of low-mem message to the content renderer client. Add APIs to handle this case. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
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
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;

Powered by Google App Engine
This is Rietveld 408576698