diff --git a/content/media/MediaRecorder.cpp b/content/media/MediaRecorder.cpp index 5127ff55d00..bb1beb149ef 100644 --- a/content/media/MediaRecorder.cpp +++ b/content/media/MediaRecorder.cpp @@ -454,8 +454,7 @@ private: // shutdown notification and stop Read Thread. nsContentUtils::RegisterShutdownObserver(this); - nsRefPtr thisSession(this); - nsRefPtr event = new ExtractRunnable(thisSession.forget()); + nsRefPtr event = new ExtractRunnable(this); if (NS_FAILED(mReadThread->Dispatch(event, NS_DISPATCH_NORMAL))) { NS_WARNING("Failed to dispatch ExtractRunnable at beginning"); } @@ -473,8 +472,7 @@ private: MOZ_ASSERT(false, "NS_DispatchToMainThread PushBlobRunnable failed"); } // Destroy this session object in main thread. - nsRefPtr thisSession(this); - if (NS_FAILED(NS_DispatchToMainThread(new DestroyRunnable(thisSession.forget())))) { + if (NS_FAILED(NS_DispatchToMainThread(new DestroyRunnable(this)))) { MOZ_ASSERT(false, "NS_DispatchToMainThread DestroyRunnable failed"); } } diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index a6a82edcd7e..c45a3ac9ddc 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -1213,12 +1213,12 @@ ServiceWorkerManager::GetServiceWorkerRegistration(nsIURI* aURI) return nullptr; } - nsRefPtr registration; - domainInfo->mServiceWorkerRegistrations.Get(scope, getter_AddRefs(registration)); + ServiceWorkerRegistration* registration; + domainInfo->mServiceWorkerRegistrations.Get(scope, ®istration); // ordered scopes and registrations better be in sync. MOZ_ASSERT(registration); - return registration.forget(); + return registration; } namespace {