| Index: components/spellcheck/browser/spellcheck_message_filter_platform_android.cc
|
| diff --git a/components/spellcheck/browser/spellcheck_message_filter_platform_android.cc b/components/spellcheck/browser/spellcheck_message_filter_platform_android.cc
|
| index 50a0e5a2d9b7b750ba7639e915a6a7847687b18c..ed3c41e3c8d006a0f0595f09b9a45cba73fbeb51 100644
|
| --- a/components/spellcheck/browser/spellcheck_message_filter_platform_android.cc
|
| +++ b/components/spellcheck/browser/spellcheck_message_filter_platform_android.cc
|
| @@ -19,8 +19,14 @@ SpellCheckMessageFilterPlatform::SpellCheckMessageFilterPlatform(
|
|
|
| void SpellCheckMessageFilterPlatform::OverrideThreadForMessage(
|
| const IPC::Message& message, BrowserThread::ID* thread) {
|
| - if (message.type() == SpellCheckHostMsg_RequestTextCheck::ID)
|
| - *thread = BrowserThread::UI;
|
| + switch (message.type()) {
|
| + case SpellCheckHostMsg_RequestTextCheck::ID:
|
| + case SpellCheckHostMsg_ToggleSpellCheck::ID:
|
| + *thread = BrowserThread::UI;
|
| + break;
|
| + default:
|
| + break;
|
| + }
|
| }
|
|
|
| bool SpellCheckMessageFilterPlatform::OnMessageReceived(
|
| @@ -91,3 +97,9 @@ void SpellCheckMessageFilterPlatform::OnToggleSpellCheck(
|
| if (!enabled)
|
| impl_->DisconnectSession();
|
| }
|
| +
|
| +void SpellCheckMessageFilterPlatform::OnDestruct() const {
|
| + // Needs to be destroyed on the UI thread, to avoid race conditions
|
| + // on the java side during clean-up.
|
| + BrowserThread::DeleteOnUIThread::Destruct(this);
|
| +}
|
|
|