Bug 1635854 - Port Bug 1635094 "Cleanup the ReferrerInfo code" cpp part. r=frg
authorBill Gianopoulos <wgianopoulos@gmail.com>
Tue, 05 May 2020 06:27:22 -0400
changeset 39072 4c84f6a17aafbc69ce4d4d1f4c9f65f6de65994a
parent 39071 f0799dbf510175a46545e62bff136187f04cd9ab
child 39073 d99e95524b9b8c64b65c9afbc47dbf8002fb418e
push id402
push userclokep@gmail.com
push dateMon, 29 Jun 2020 20:48:04 +0000
reviewersfrg
bugs1635854, 1635094
Bug 1635854 - Port Bug 1635094 "Cleanup the ReferrerInfo code" cpp part. r=frg
suite/components/shell/nsMacShellService.cpp
--- a/suite/components/shell/nsMacShellService.cpp
+++ b/suite/components/shell/nsMacShellService.cpp
@@ -167,19 +167,17 @@ nsMacShellService::SetDesktopBackground(
   nsCOMPtr<nsILoadContext> loadContext;
   nsCOMPtr<nsISupports> container = aElement->OwnerDoc()->GetContainer();
   nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(container);
   if (docShell)
   {
     loadContext = do_QueryInterface(docShell);
   }
 
-  nsCOMPtr<nsIReferrerInfo> referrerInfo = new mozilla::dom::ReferrerInfo();
-  referrerInfo->InitWithNode(aElement);
-
+  auto referrerInfo = mozilla::MakeRefPtr<mozilla::dom::ReferrerInfo>(*aElement);
   return wbp->SaveURI(imageURI, aElement->NodePrincipal(), 0, referrerInfo,
                       nullptr, nullptr, mBackgroundFile,
                       nsIContentPolicy::TYPE_IMAGE, loadContext);
 }
 
 NS_IMETHODIMP
 nsMacShellService::OnProgressChange(nsIWebProgress* aWebProgress,
                                     nsIRequest* aRequest,