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

Unified Diff: components/spellcheck/renderer/hunspell_engine.cc

Issue 2857353002: Convert Spellcheck host MessageFilter IPC to mojo (Closed)
Patch Set: Use MakeUnique for the MessageLoop in TestingSpellCheckProvider. Created 3 years, 7 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
« no previous file with comments | « components/spellcheck/common/spellcheck_messages.h ('k') | components/spellcheck/renderer/spellcheck.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/spellcheck/renderer/hunspell_engine.cc
diff --git a/components/spellcheck/renderer/hunspell_engine.cc b/components/spellcheck/renderer/hunspell_engine.cc
index c3853483105a48ed19f23c374a19c26c8a431564..d8266d7642553806da02ecbe5b301bbd2c6d074f 100644
--- a/components/spellcheck/renderer/hunspell_engine.cc
+++ b/components/spellcheck/renderer/hunspell_engine.cc
@@ -11,10 +11,13 @@
#include "base/files/memory_mapped_file.h"
#include "base/time/time.h"
+#include "components/spellcheck/common/spellcheck.mojom.h"
#include "components/spellcheck/common/spellcheck_common.h"
#include "components/spellcheck/common/spellcheck_messages.h"
#include "components/spellcheck/spellcheck_build_features.h"
+#include "content/public/common/service_names.mojom.h"
#include "content/public/renderer/render_thread.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "third_party/hunspell/src/hunspell/hunspell.hxx"
using content::RenderThread;
@@ -119,8 +122,12 @@ void HunspellEngine::FillSuggestionList(
bool HunspellEngine::InitializeIfNeeded() {
if (!initialized_ && !dictionary_requested_) {
// RenderThread will not exist in test.
- if (RenderThread::Get())
- RenderThread::Get()->Send(new SpellCheckHostMsg_RequestDictionary);
+ if (RenderThread::Get()) {
+ spellcheck::mojom::SpellCheckHostPtr spellcheck_host;
+ RenderThread::Get()->GetConnector()->BindInterface(
+ content::mojom::kBrowserServiceName, &spellcheck_host);
+ spellcheck_host->RequestDictionary();
+ }
dictionary_requested_ = true;
return true;
}
« no previous file with comments | « components/spellcheck/common/spellcheck_messages.h ('k') | components/spellcheck/renderer/spellcheck.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698