From 76ef6dec31e3fd4332bda7dc15ed52eb7f9323b8 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 21 Jul 2010 11:33:32 -0400 Subject: [PATCH] Bug 578696 part 5. Stop holding strong refs when calling CharacterDataWillChange. r=sicking --- content/base/public/nsIMutationObserver.h | 6 ++++++ content/base/src/nsNodeUtils.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/content/base/public/nsIMutationObserver.h b/content/base/public/nsIMutationObserver.h index 4913fdfecf4..97a8434d810 100644 --- a/content/base/public/nsIMutationObserver.h +++ b/content/base/public/nsIMutationObserver.h @@ -117,6 +117,12 @@ public: * @param aDocument The owner-document of aContent. Can be null. * @param aContent The piece of content that changed. Is never null. * @param aInfo The structure with information details about the change. + * + * @note Callers of this method might not hold a strong reference to the + * observer. The observer is responsible for making sure it stays + * alive for the duration of the call as needed. The observer may + * assume that this call will happen when there are script blockers on + * the stack. */ virtual void CharacterDataWillChange(nsIDocument *aDocument, nsIContent* aContent, diff --git a/content/base/src/nsNodeUtils.cpp b/content/base/src/nsNodeUtils.cpp index 3697ae7ea02..866093c6f66 100644 --- a/content/base/src/nsNodeUtils.cpp +++ b/content/base/src/nsNodeUtils.cpp @@ -114,7 +114,7 @@ nsNodeUtils::CharacterDataWillChange(nsIContent* aContent, CharacterDataChangeInfo* aInfo) { nsIDocument* doc = aContent->GetOwnerDoc(); - IMPL_STRONGREF_MUTATION_NOTIFICATION(CharacterDataWillChange, aContent, + IMPL_MUTATION_NOTIFICATION(CharacterDataWillChange, aContent, (doc, aContent, aInfo)); }