Bug 1620661 - Remove GetUri in nsAlertsUtils.cpp r=ckerschb
authorSebastian Streich <sstreich@mozilla.com>
Mon, 09 Mar 2020 17:02:48 +0000
changeset 517658 e0291795a75011884160c92ff363bd2873bc4524
parent 517657 f41739c64dff7f559754d90f993b5abe60f5f8a1
child 517659 2b7446e9eca4672ba4a8cd3744837a45701551e6
push id37199
push useropoprus@mozilla.com
push dateTue, 10 Mar 2020 03:43:44 +0000
treeherdermozilla-central@6f21f98dcfcd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersckerschb
bugs1620661
milestone75.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 1620661 - Remove GetUri in nsAlertsUtils.cpp r=ckerschb Differential Revision: https://phabricator.services.mozilla.com/D65770
toolkit/components/alerts/nsAlertsUtils.cpp
--- a/toolkit/components/alerts/nsAlertsUtils.cpp
+++ b/toolkit/components/alerts/nsAlertsUtils.cpp
@@ -17,21 +17,14 @@ bool nsAlertsUtils::IsActionablePrincipa
 }
 
 /* static */
 void nsAlertsUtils::GetSourceHostPort(nsIPrincipal* aPrincipal,
                                       nsAString& aHostPort) {
   if (!IsActionablePrincipal(aPrincipal)) {
     return;
   }
-  nsCOMPtr<nsIURI> principalURI;
-  if (NS_WARN_IF(NS_FAILED(aPrincipal->GetURI(getter_AddRefs(principalURI))))) {
-    return;
-  }
-  if (!principalURI) {
-    return;
-  }
   nsAutoCString hostPort;
-  if (NS_WARN_IF(NS_FAILED(principalURI->GetHostPort(hostPort)))) {
+  if (NS_WARN_IF(NS_FAILED(aPrincipal->GetHostPort(hostPort)))) {
     return;
   }
   CopyUTF8toUTF16(hostPort, aHostPort);
 }