Bug 1391421 - Part 1 - Switch nsAndroidHistory to Unicode domains. r?esawin draft
authorJan Henning <jh+bugzilla@buttercookie.de>
Thu, 14 Sep 2017 21:46:35 +0200
changeset 665962 5dbd59440929fb1358ef79bfed3835447cc188b9
parent 665961 6df54927ad02b13b5d9ee0d81c494d40f8f26160
child 665963 71361a0a2979581828a8b0e6d7d3b1c8c7cc7204
push id80237
push usermozilla@buttercookie.de
push dateSat, 16 Sep 2017 21:17:08 +0000
reviewersesawin
bugs1391421
milestone57.0a1
Bug 1391421 - Part 1 - Switch nsAndroidHistory to Unicode domains. r?esawin MozReview-Commit-ID: FoxZhwdg4ao
mobile/android/components/build/nsAndroidHistory.cpp
--- a/mobile/android/components/build/nsAndroidHistory.cpp
+++ b/mobile/android/components/build/nsAndroidHistory.cpp
@@ -60,17 +60,17 @@ nsAndroidHistory::RegisterVisitedCallbac
   bool canAdd;
   nsresult rv = CanAddURI(aURI, &canAdd);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!canAdd) {
     return NS_OK;
   }
 
   nsAutoCString uri;
-  rv = aURI->GetSpec(uri);
+  rv = aURI->GetDisplaySpec(uri);
   if (NS_FAILED(rv)) return rv;
   NS_ConvertUTF8toUTF16 uriString(uri);
 
   nsTArray<Link*>* list = mListeners.Get(uriString);
   if (! list) {
     list = new nsTArray<Link*>();
     mListeners.Put(uriString, list);
   }
@@ -85,17 +85,17 @@ nsAndroidHistory::RegisterVisitedCallbac
 
 NS_IMETHODIMP
 nsAndroidHistory::UnregisterVisitedCallback(nsIURI *aURI, Link *aContent)
 {
   if (!aContent || !aURI)
     return NS_OK;
 
   nsAutoCString uri;
-  nsresult rv = aURI->GetSpec(uri);
+  nsresult rv = aURI->GetDisplaySpec(uri);
   if (NS_FAILED(rv)) return rv;
   NS_ConvertUTF8toUTF16 uriString(uri);
 
   nsTArray<Link*>* list = mListeners.Get(uriString);
   if (! list)
     return NS_OK;
 
   list->RemoveElement(aContent);
@@ -204,17 +204,17 @@ nsAndroidHistory::GetName(nsACString& aN
 void
 nsAndroidHistory::SaveVisitURI(nsIURI* aURI) {
   // Add the URI to our cache so we can take a fast path later
   AppendToRecentlyVisitedURIs(aURI);
 
   if (jni::IsFennec()) {
     // Save this URI in our history
     nsAutoCString spec;
-    (void)aURI->GetSpec(spec);
+    (void)aURI->GetDisplaySpec(spec);
     java::GlobalHistory::MarkURIVisited(NS_ConvertUTF8toUTF16(spec));
   }
 
   // Finally, notify that we've been visited.
   nsCOMPtr<nsIObserverService> obsService = mozilla::services::GetObserverService();
   if (obsService) {
     obsService->NotifyObservers(aURI, NS_LINK_VISITED_EVENT_TOPIC, nullptr);
   }
@@ -287,34 +287,34 @@ nsAndroidHistory::SetURITitle(nsIURI *aU
   }
 
   if (IsEmbedURI(aURI)) {
     return NS_OK;
   }
 
   if (jni::IsFennec()) {
     nsAutoCString uri;
-    nsresult rv = aURI->GetSpec(uri);
+    nsresult rv = aURI->GetDisplaySpec(uri);
     if (NS_FAILED(rv)) return rv;
     if (RemovePendingVisitURI(aURI)) {
       // We have a title, so aURI isn't a redirect, so save the visit now before setting the title.
       SaveVisitURI(aURI);
     }
     NS_ConvertUTF8toUTF16 uriString(uri);
     java::GlobalHistory::SetURITitle(uriString, aTitle);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAndroidHistory::NotifyVisited(nsIURI *aURI)
 {
   if (aURI && sHistory) {
     nsAutoCString spec;
-    (void)aURI->GetSpec(spec);
+    (void)aURI->GetDisplaySpec(spec);
     sHistory->mPendingLinkURIs.Push(NS_ConvertUTF8toUTF16(spec));
     NS_DispatchToMainThread(sHistory);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAndroidHistory::Run()