Bug 1505029. Teach our static analysis about nsCOMPtr<nsISupports> being a strong ref. r=mccr8
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 12 Mar 2019 21:04:07 +0000
changeset 521603 356a982f5ba4
parent 521602 6226618708d2
child 521604 47e570e51385
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1505029
milestone67.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 1505029. Teach our static analysis about nsCOMPtr<nsISupports> being a strong ref. r=mccr8 Differential Revision: https://phabricator.services.mozilla.com/D23021
editor/libeditor/HTMLEditor.h
xpcom/base/nsCOMPtr.h
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -1935,17 +1935,17 @@ class HTMLEditor final : public TextEdit
    *                        If aAddCites is false, this will be null.
    */
   nsresult InsertAsPlaintextQuotation(const nsAString& aQuotedText,
                                       bool aAddCites, nsINode** aNodeInserted);
 
   /**
    * InsertObject() inserts given object at aPointToInsert.
    */
-  MOZ_CAN_RUN_SCRIPT_BOUNDARY
+  MOZ_CAN_RUN_SCRIPT
   nsresult InsertObject(const nsACString& aType, nsISupports* aObject,
                         bool aIsSafe, Document* aSourceDoc,
                         const EditorDOMPoint& aPointToInsert,
                         bool aDoDeleteSelection);
 
   // factored methods for handling insertion of data from transferables
   // (drag&drop or clipboard)
   virtual nsresult PrepareTransferable(nsITransferable** transferable) override;
--- a/xpcom/base/nsCOMPtr.h
+++ b/xpcom/base/nsCOMPtr.h
@@ -870,17 +870,17 @@ class MOZ_IS_REFPTR nsCOMPtr final
  * the same way people use nsISupports* and void*, i.e., as a `catch-all'
  * pointing to any valid [XP]COM interface. Otherwise, an nsCOMPtr<nsISupports>
  * would only be able to point to the single [XP]COM-correct nsISupports
  * instance within an object; extra querying ensues. Clients need to be able to
  * pass around arbitrary interface pointers, without hassles, through
  * intermediary code that doesn't know the exact type.
  */
 template <>
-class nsCOMPtr<nsISupports> : private nsCOMPtr_base {
+class MOZ_IS_REFPTR nsCOMPtr<nsISupports> : private nsCOMPtr_base {
  public:
   typedef nsISupports element_type;
 
   // Constructors
 
   nsCOMPtr() : nsCOMPtr_base(nullptr) { NSCAP_LOG_ASSIGNMENT(this, nullptr); }
 
   MOZ_IMPLICIT nsCOMPtr(decltype(nullptr)) : nsCOMPtr_base(nullptr) {