Bug 1167597 - Mark PromiseReportRejectFeature::mPromise as MOZ_NON_OWNING_REF. r=ehsan
--- a/dom/promise/Promise.h
+++ b/dom/promise/Promise.h
@@ -45,18 +45,19 @@ class PromiseInit;
class PromiseNativeHandler;
class PromiseDebugging;
class Promise;
#if defined(DOM_PROMISE_DEPRECATED_REPORTING)
class PromiseReportRejectFeature : public workers::WorkerFeature
{
- // The Promise that owns this feature.
- Promise* mPromise;
+ // PromiseReportRejectFeature is held by an nsAutoPtr on the Promise which
+ // means that this object will be destroyed before the Promise is destroyed.
+ Promise* MOZ_NON_OWNING_REF mPromise;
public:
explicit PromiseReportRejectFeature(Promise* aPromise)
: mPromise(aPromise)
{
MOZ_ASSERT(mPromise);
}