Bug 861893 - Do not hold on to nsITextServicesDocument unnecessarily in the editor and the spell checker code; r=roc

This commit is contained in:
Ehsan Akhgari 2013-04-16 00:07:32 -04:00
parent ba2695f44e
commit 9483f3383d
4 changed files with 1 additions and 20 deletions

View File

@ -162,7 +162,6 @@ nsHTMLEditor::HideAnonymousEditingUIs()
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTypeInState)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mStyleSheets)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTextServices)
tmp->HideAnonymousEditingUIs();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
@ -170,7 +169,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsHTMLEditor, nsPlaintextEditor)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTypeInState)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mStyleSheets)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTextServices)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTopLeftHandle)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTopHandle)

View File

@ -14,7 +14,6 @@
#include "nsITableEditor.h"
#include "nsIEditorMailSupport.h"
#include "nsIEditorStyleSheets.h"
#include "nsITextServicesDocument.h"
#include "nsEditor.h"
#include "nsIDOMElement.h"
@ -766,9 +765,6 @@ protected:
// an array for holding default style settings
nsTArray<PropItem*> mDefaultStyles;
// for real-time spelling
nsCOMPtr<nsITextServicesDocument> mTextServices;
protected:
/* ANONYMOUS UTILS */

View File

@ -481,9 +481,8 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(mozInlineSpellChecker)
NS_IMPL_CYCLE_COLLECTING_RELEASE(mozInlineSpellChecker)
NS_IMPL_CYCLE_COLLECTION_4(mozInlineSpellChecker,
NS_IMPL_CYCLE_COLLECTION_3(mozInlineSpellChecker,
mSpellCheck,
mTextServicesDocument,
mTreeWalker,
mCurrentSelectionAnchorNode)
@ -675,16 +674,6 @@ mozInlineSpellChecker::SetEnableRealTimeSpell(bool aEnabled)
res = spellchecker->InitSpellChecker(editor, false);
NS_ENSURE_SUCCESS(res, res);
nsCOMPtr<nsITextServicesDocument> tsDoc = do_CreateInstance("@mozilla.org/textservices/textservicesdocument;1", &res);
NS_ENSURE_SUCCESS(res, res);
res = tsDoc->SetFilter(filter);
NS_ENSURE_SUCCESS(res, res);
res = tsDoc->InitWithEditor(editor);
NS_ENSURE_SUCCESS(res, res);
mTextServicesDocument = tsDoc;
mSpellCheck = spellchecker;
// spell checking is enabled, register our event listeners to track navigation

View File

@ -11,7 +11,6 @@
#include "nsIEditorSpellCheck.h"
#include "nsIEditActionListener.h"
#include "nsIInlineSpellChecker.h"
#include "nsITextServicesDocument.h"
#include "nsIDOMTreeWalker.h"
#include "nsWeakReference.h"
#include "nsEditor.h"
@ -130,7 +129,6 @@ private:
nsWeakPtr mEditor;
nsCOMPtr<nsIEditorSpellCheck> mSpellCheck;
nsCOMPtr<nsITextServicesDocument> mTextServicesDocument;
nsCOMPtr<nsIDOMTreeWalker> mTreeWalker;
nsCOMPtr<mozISpellI18NUtil> mConverter;