Bug 1621307 - Remove Geturi in txMozillaStylesheetCompiler r=ckerschb
authorSebastian Streich <sstreich@mozilla.com>
Thu, 12 Mar 2020 19:47:54 +0000
changeset 518502 dbb45e31e5af1ee8df157eee5e6bc3075f90b5d7
parent 518501 01cef303083885956bf7ef64eeda2d4e07a09c85
child 518503 fc2cf95fd031435de3f9edccb6c330b0fe14d812
push id110001
push usercsabou@mozilla.com
push dateThu, 12 Mar 2020 21:13:20 +0000
treeherderautoland@fc2cf95fd031 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1621307
milestone76.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 1621307 - Remove Geturi in txMozillaStylesheetCompiler r=ckerschb Differential Revision: https://phabricator.services.mozilla.com/D66249
dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
--- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
+++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
@@ -403,22 +403,20 @@ nsresult txCompileObserver::startLoad(ns
       loadGroup);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   channel->SetContentType(NS_LITERAL_CSTRING("text/xml"));
 
   nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
   if (httpChannel) {
-    nsCOMPtr<nsIURI> referrerURI;
-    aReferrerPrincipal->GetURI(getter_AddRefs(referrerURI));
-    if (referrerURI) {
-      DebugOnly<nsresult> rv;
-      nsCOMPtr<nsIReferrerInfo> referrerInfo =
-          new dom::ReferrerInfo(referrerURI, aReferrerPolicy);
+    nsCOMPtr<nsIReferrerInfo> referrerInfo;
+    nsresult rv = aReferrerPrincipal->CreateReferrerInfo(
+        aReferrerPolicy, getter_AddRefs(referrerInfo));
+    if (NS_SUCCEEDED(rv)) {
       rv = httpChannel->SetReferrerInfoWithoutClone(referrerInfo);
       MOZ_ASSERT(NS_SUCCEEDED(rv));
     }
   }
 
   nsCOMPtr<nsIParser> parser = do_CreateInstance(kCParserCID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);