From 44d2b36effffd47a62c182fba52d4fc3e8b7c036 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Thu, 9 Sep 2021 13:37:46 +0000 Subject: [DOM] Use RefPtr in ContentChild::RecvGetFilesResponse. --- dom/ipc/ContentChild.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'dom') diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 046934277c..5ff77092ab 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -2817,10 +2817,10 @@ bool ContentChild::RecvGetFilesResponse(const nsID& aUUID, const GetFilesResponseResult& aResult) { - GetFilesHelperChild* child = mGetFilesPendingRequests.GetWeak(aUUID); + RefPtr child; // This object can already been deleted in case DeleteGetFilesRequest has // been called when the response was sending by the parent. - if (!child) { + if (!mGetFilesPendingRequests.Remove(aUUID, getter_AddRefs(child))) { return true; } @@ -2841,7 +2841,6 @@ ContentChild::RecvGetFilesResponse(const nsID& aUUID, child->Finished(succeeded ? NS_OK : NS_ERROR_OUT_OF_MEMORY); } - mGetFilesPendingRequests.Remove(aUUID); return true; } -- cgit v1.2.3