Bug 1504913 - Part 1. Use mozSpellChecker directly instead of nsISpellChecker. r=masayuki
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Tue, 06 Nov 2018 12:31:36 +0900
changeset 444840 6a089fb17fe6f8039ecd0b071492edd489a2c0a0
parent 444797 274f95b85267d07ae0d2eceb95c683dda098ce82
child 444841 b3888d4eeaa3b1e9394c6b21393a3bd27fddbd9f
push id35004
push userncsoregi@mozilla.com
push dateWed, 07 Nov 2018 16:18:19 +0000
treeherdermozilla-central@d87537833fcf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1504913
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1504913 - Part 1. Use mozSpellChecker directly instead of nsISpellChecker. r=masayuki When creating an instance of nsISpellChecker, we always use mozSpellChecker::Create. So we should use mozSpellChecker directly instead of nsISpellChecker. Differential Revision: https://phabricator.services.mozilla.com/D10993
dom/ipc/ContentChild.cpp
dom/ipc/ContentParent.cpp
editor/spellchecker/EditorSpellCheck.h
extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineParent.h
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -139,17 +139,16 @@
 #include "nsIConsoleService.h"
 #include "nsJSEnvironment.h"
 #include "SandboxHal.h"
 #include "nsDebugImpl.h"
 #include "nsHashPropertyBag.h"
 #include "nsLayoutStylesheetCache.h"
 #include "nsThreadManager.h"
 #include "nsAnonymousTemporaryFile.h"
-#include "nsISpellChecker.h"
 #include "nsClipboardProxy.h"
 #include "nsDirectoryService.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsContentPermissionHelper.h"
 #include "nsPluginHost.h"
 #ifdef NS_PRINTING
 #include "nsPrintingProxy.h"
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2444,17 +2444,17 @@ ContentParent::InitInternal(ProcessPrior
 
   xpcomInit.isLangRTL() = false;
   xpcomInit.haveBidiKeyboards() = false;
   if (bidi) {
     bidi->IsLangRTL(&xpcomInit.isLangRTL());
     bidi->GetHaveBidiKeyboards(&xpcomInit.haveBidiKeyboards());
   }
 
-  nsCOMPtr<nsISpellChecker> spellChecker(mozSpellChecker::Create());
+  RefPtr<mozSpellChecker> spellChecker(mozSpellChecker::Create());
   MOZ_ASSERT(spellChecker, "No spell checker?");
 
   spellChecker->GetDictionaryList(&xpcomInit.dictionaries());
 
   LocaleService::GetInstance()->GetAppLocalesAsLangTags(xpcomInit.appLocales());
   LocaleService::GetInstance()->GetRequestedLocales(xpcomInit.requestedLocales());
 
   nsCOMPtr<nsIClipboard> clipboard(do_GetService("@mozilla.org/widget/clipboard;1"));
@@ -4617,17 +4617,17 @@ ContentParent::IgnoreIPCPrincipal()
                                  "dom.testing.ignore_ipc_principal", false);
   }
   return sIgnoreIPCPrincipal;
 }
 
 void
 ContentParent::NotifyUpdatedDictionaries()
 {
-  nsCOMPtr<nsISpellChecker> spellChecker(mozSpellChecker::Create());
+  RefPtr<mozSpellChecker> spellChecker(mozSpellChecker::Create());
   MOZ_ASSERT(spellChecker, "No spell checker?");
 
   InfallibleTArray<nsString> dictionaries;
   spellChecker->GetDictionaryList(&dictionaries);
 
   for (auto* cp : AllProcesses(eLive)) {
     Unused << cp->SendUpdateDictionaryList(dictionaries);
   }
--- a/editor/spellchecker/EditorSpellCheck.h
+++ b/editor/spellchecker/EditorSpellCheck.h
@@ -12,17 +12,16 @@
 #include "nsIEditorSpellCheck.h"        // for NS_DECL_NSIEDITORSPELLCHECK, etc
 #include "nsISupportsImpl.h"
 #include "nsString.h"                   // for nsString
 #include "nsTArray.h"                   // for nsTArray
 #include "nscore.h"                     // for nsresult
 
 class mozSpellChecker;
 class nsIEditor;
-class nsISpellChecker;
 
 namespace mozilla {
 
 class DictionaryFetcher;
 class EditorBase;
 
 enum dictCompare
 {
--- a/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineParent.h
+++ b/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineParent.h
@@ -3,17 +3,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #ifndef RemoteSpellcheckEngineParent_h_
 #define RemoteSpellcheckEngineParent_h_
 
 #include "mozilla/PRemoteSpellcheckEngineParent.h"
 #include "nsCOMPtr.h"
 #include "nsTArray.h"
 
-class nsISpellChecker;
+class mozSpellChecker;
 
 namespace mozilla {
 
 class RemoteSpellcheckEngineParent : public PRemoteSpellcheckEngineParent
 {
 public:
   RemoteSpellcheckEngineParent();
 
@@ -31,14 +31,14 @@ public:
   virtual mozilla::ipc::IPCResult RecvCheck(const nsString& aWord, bool* aIsMisspelled) override;
 
   virtual mozilla::ipc::IPCResult RecvCheckAndSuggest(const nsString& aWord,
                                                       bool* aIsMisspelled,
                                                       InfallibleTArray<nsString>* aSuggestions)
       override;
 
 private:
-  nsCOMPtr<nsISpellChecker> mSpellChecker;
+  RefPtr<mozSpellChecker> mSpellChecker;
 };
 
 } // namespace mozilla
 
 #endif