Bug 1156100 - Mark XULDocument::CachedChromeStreamListener::mDocument as an nsRefPtr; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Sun, 19 Apr 2015 11:08:13 -0400
changeset 239987 6d602ee95398c1c8877291911e9b94b1d7110fd2
parent 239986 a0ece8afbd2f1bce4c3632ebc6439219223c8c52
child 239988 c199d88d853cee83de2a1aae6a27f41f957c4db2
push id28618
push userkwierso@gmail.com
push dateMon, 20 Apr 2015 23:44:35 +0000
treeherdermozilla-central@bfbb2f3babcb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1156100
milestone40.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 1156100 - Mark XULDocument::CachedChromeStreamListener::mDocument as an nsRefPtr; r=baku
dom/xul/XULDocument.cpp
dom/xul/XULDocument.h
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -4429,23 +4429,21 @@ XULDocument::RemoveElement(nsINode* aPar
 //
 // CachedChromeStreamListener
 //
 
 XULDocument::CachedChromeStreamListener::CachedChromeStreamListener(XULDocument* aDocument, bool aProtoLoaded)
     : mDocument(aDocument),
       mProtoLoaded(aProtoLoaded)
 {
-    NS_ADDREF(mDocument);
 }
 
 
 XULDocument::CachedChromeStreamListener::~CachedChromeStreamListener()
 {
-    NS_RELEASE(mDocument);
 }
 
 
 NS_IMPL_ISUPPORTS(XULDocument::CachedChromeStreamListener,
                   nsIRequestObserver, nsIStreamListener)
 
 NS_IMETHODIMP
 XULDocument::CachedChromeStreamListener::OnStartRequest(nsIRequest *request,
--- a/dom/xul/XULDocument.h
+++ b/dom/xul/XULDocument.h
@@ -679,18 +679,18 @@ protected:
     /**
      * Report that an overlay failed to load
      * @param aURI the URI of the overlay that failed to load
      */
     void ReportMissingOverlay(nsIURI* aURI);
 
     class CachedChromeStreamListener : public nsIStreamListener {
     protected:
-        XULDocument* mDocument;
-        bool         mProtoLoaded;
+        nsRefPtr<XULDocument> mDocument;
+        bool mProtoLoaded;
 
         virtual ~CachedChromeStreamListener();
 
     public:
         CachedChromeStreamListener(XULDocument* aDocument,
                                    bool aProtoLoaded);
 
         NS_DECL_ISUPPORTS