Bug 1460509 - part 70: Mark HTMLEditRules::WillMakeBasicBlock() as MOZ_MUST_USE since it may return NS_ERROR_EDITOR_DESTROYED r?m_kato draft
authorMasayuki Nakano <masayuki@d-toybox.com>
Thu, 17 May 2018 20:01:19 +0900
changeset 798788 5a402d861d0ed429a59a136231ed7d24518d79e5
parent 798787 1adc8c22446a3b9bd313193f8bacc5e5681d22ae
child 798789 bb20a0b9d5f005293116c9cb99277637c2127482
push id110840
push usermasayuki@d-toybox.com
push dateWed, 23 May 2018 13:41:58 +0000
reviewersm_kato
bugs1460509
milestone62.0a1
Bug 1460509 - part 70: Mark HTMLEditRules::WillMakeBasicBlock() as MOZ_MUST_USE since it may return NS_ERROR_EDITOR_DESTROYED r?m_kato MozReview-Commit-ID: 6mfoqUWync8
editor/libeditor/HTMLEditRules.h
--- a/editor/libeditor/HTMLEditRules.h
+++ b/editor/libeditor/HTMLEditRules.h
@@ -398,18 +398,27 @@ protected:
    * @param aCancel             Returns true if the operation is canceled.
    * @param aHandled            Returns true if the edit action is handled.
    */
   MOZ_MUST_USE nsresult
   WillRelativeChangeZIndex(int32_t aChange, bool* aCancel, bool* aHandled);
 
   nsresult WillMakeDefListItem(const nsAString* aBlockType, bool aEntireList,
                                bool* aCancel, bool* aHandled);
-  nsresult WillMakeBasicBlock(const nsAString& aBlockType,
-                              bool* aCancel, bool* aHandled);
+
+  /**
+   * WillMakeBasicBlock() called before changing block style around Selection.
+   * This method actually does something with calling MakeBasicBlock().
+   *
+   * @param aBlockType          Necessary block style as string.
+   * @param aCancel             Returns true if the operation is canceled.
+   * @param aHandled            Returns true if the edit action is handled.
+   */
+  MOZ_MUST_USE nsresult WillMakeBasicBlock(const nsAString& aBlockType,
+                                           bool* aCancel, bool* aHandled);
 
   /**
    * MakeBasicBlock() applies or clears block style around Selection.
    * This method creates AutoSelectionRestorer.  Therefore, each caller
    * need to check if the editor is still available even if this returns
    * NS_OK.
    *
    * @param aBlockType          New block tag name.