Chromium Code Reviews| Index: chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc |
| diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc b/chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc |
| index 4c7a6c8c2239632cf080c976e6c18a63d524d54b..6824cc2711c1c17279ea06afc5805702b22d6b9e 100644 |
| --- a/chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc |
| +++ b/chrome/browser/spellchecker/spellcheck_message_filter_platform_android.cc |
| @@ -4,6 +4,9 @@ |
| #include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h" |
| +#include "base/barrier_closure.h" |
| +#include "base/bind.h" |
| +#include "chrome/browser/spellchecker/spellcheck_platform.h" |
|
please use gerrit instead
2015/08/11 16:43:46
Unused includes.
dylanking
2015/08/12 01:29:55
Deleted, thanks for catching these.
|
| #include "chrome/common/spellcheck_messages.h" |
| #include "chrome/common/spellcheck_result.h" |
| #include "content/public/browser/browser_thread.h" |
| @@ -13,16 +16,23 @@ using content::BrowserThread; |
| SpellCheckMessageFilterPlatform::SpellCheckMessageFilterPlatform( |
| int render_process_id) |
| : BrowserMessageFilter(SpellCheckMsgStart), |
| - render_process_id_(render_process_id) { |
| -} |
| + render_process_id_(render_process_id), |
| + impl_(new SpellCheckerSessionBridge(render_process_id)) {} |
| void SpellCheckMessageFilterPlatform::OverrideThreadForMessage( |
| const IPC::Message& message, BrowserThread::ID* thread) { |
| + if (message.type() == SpellCheckHostMsg_RequestTextCheck::ID) |
| + *thread = BrowserThread::UI; |
| } |
| bool SpellCheckMessageFilterPlatform::OnMessageReceived( |
| const IPC::Message& message) { |
| - return true; |
| + bool handled = true; |
| + IPC_BEGIN_MESSAGE_MAP(SpellCheckMessageFilterPlatform, message) |
| + IPC_MESSAGE_HANDLER(SpellCheckHostMsg_RequestTextCheck, OnRequestTextCheck) |
| + IPC_MESSAGE_UNHANDLED(handled = false) |
| + IPC_END_MESSAGE_MAP() |
| + return handled; |
| } |
| // static |
| @@ -56,13 +66,17 @@ void SpellCheckMessageFilterPlatform::OnRequestTextCheck( |
| int identifier, |
| const base::string16& text, |
| std::vector<SpellCheckMarker> markers) { |
| + DCHECK(!text.empty()); |
| + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| + |
| + impl_->RequestTextCheck(route_id, identifier, text); |
| } |
| int SpellCheckMessageFilterPlatform::ToDocumentTag(int route_id) { |
| - NOTREACHED(); |
| - return -1; |
| + NOTREACHED(); |
| + return -1; |
| } |
| void SpellCheckMessageFilterPlatform::RetireDocumentTag(int route_id) { |
| - NOTREACHED(); |
| + NOTREACHED(); |
| } |