Bug 1167590 - Mark imgRequestProxy::mListener as MOZ_UNSAFE_REF. r=seth
authorMichael Layzell <michael@thelayzells.com>
Mon, 15 Jun 2015 14:21:00 -0400
changeset 281476 1f62853f6c43abe8ea9732ef059419293c2c9ba5
parent 281475 ef1d868c5a85838c0b44c11f900b8e06b6035358
child 281477 60b6d9795c7a7c3d3e50c10790929d4479adc1ae
push id897
push userjlund@mozilla.com
push dateMon, 14 Sep 2015 18:56:12 +0000
treeherdermozilla-release@9411e2d2b214 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs1167590
milestone41.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 1167590 - Mark imgRequestProxy::mListener as MOZ_UNSAFE_REF. r=seth
image/imgRequestProxy.h
--- a/image/imgRequestProxy.h
+++ b/image/imgRequestProxy.h
@@ -199,17 +199,20 @@ private:
   friend imgRequestProxy* NewStaticProxy(imgRequestProxy* aThis);
 
   // The URI of our request.
   nsRefPtr<ImageURL> mURI;
 
   // mListener is only promised to be a weak ref (see imgILoader.idl),
   // but we actually keep a strong ref to it until we've seen our
   // first OnStopRequest.
-  imgINotificationObserver* mListener;
+  imgINotificationObserver* MOZ_UNSAFE_REF("Observers must call Cancel() or "
+                                           "CancelAndForgetObserver() before "
+                                           "they are destroyed") mListener;
+
   nsCOMPtr<nsILoadGroup> mLoadGroup;
 
   nsLoadFlags mLoadFlags;
   uint32_t    mLockCount;
   uint32_t    mAnimationConsumers;
   bool mCanceled;
   bool mIsInLoadGroup;
   bool mListenerIsStrongRef;