From ea3a2ce279f92457bfd6168f97b106be193ea740 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 17 Apr 2020 05:45:53 -0400 Subject: Bug 1372829 - Part 1: Make mozilla::PlaceholderTransaction inherit mozilla::SupportsWeakPtr instead of nsSupportsWeakReference Tag #1375 --- editor/libeditor/PlaceholderTransaction.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'editor/libeditor/PlaceholderTransaction.h') diff --git a/editor/libeditor/PlaceholderTransaction.h b/editor/libeditor/PlaceholderTransaction.h index 7e592cc03..5fa58a1e9 100644 --- a/editor/libeditor/PlaceholderTransaction.h +++ b/editor/libeditor/PlaceholderTransaction.h @@ -9,6 +9,7 @@ #include "EditAggregateTransaction.h" #include "mozilla/EditorUtils.h" #include "mozilla/UniquePtr.h" +#include "mozilla/WeakPtr.h" #include "nsIAbsorbingTransaction.h" #include "nsIDOMNode.h" #include "nsCOMPtr.h" @@ -26,11 +27,14 @@ class CompositionTransaction; * transactions it has absorbed. */ -class PlaceholderTransaction final : public EditAggregateTransaction, - public nsIAbsorbingTransaction, - public nsSupportsWeakReference +class PlaceholderTransaction final + : public EditAggregateTransaction + , public nsIAbsorbingTransaction + , public SupportsWeakPtr { public: + MOZ_DECLARE_WEAKREFERENCE_TYPENAME(PlaceholderTransaction) + NS_DECL_ISUPPORTS_INHERITED PlaceholderTransaction(EditorBase& aEditorBase, nsIAtom* aName, @@ -59,6 +63,11 @@ public: NS_IMETHOD Commit() override; + NS_IMETHOD_(PlaceholderTransaction*) AsPlaceholderTransaction() override + { + return this; + } + nsresult RememberEndingSelection(); protected: -- cgit v1.2.3