Bug 1297117 - Add documentation to stripAboutReaderUrl r?sebastian draft
authorAndrzej Hunt <ahunt@mozilla.com>
Fri, 02 Sep 2016 12:35:47 -0700
changeset 409423 b128f77a73739c109d54beeafc1b6ab25c272687
parent 409422 770479e18c32b6571b87b0974fa72720ae42d9f5
child 409424 3da63d9f85c496f3633161229f61cfc99efca06b
push id28461
push userahunt@mozilla.com
push dateFri, 02 Sep 2016 19:39:30 +0000
reviewerssebastian
bugs1297117
milestone51.0a1
Bug 1297117 - Add documentation to stripAboutReaderUrl r?sebastian MozReview-Commit-ID: Ibzhnk7LLmh
mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java
--- a/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java
+++ b/mobile/android/base/java/org/mozilla/gecko/reader/ReaderModeUtils.java
@@ -40,16 +40,22 @@ public class ReaderModeUtils {
 
         return urlFromAboutReader.equals(currentUrl);
     }
 
     public static String getAboutReaderForUrl(String url) {
         return getAboutReaderForUrl(url, -1);
     }
 
+    /**
+     * Obtain the underlying URL from an about:reader URL.
+     * This will return the input URL if either of the following is true:
+     * 1. the input URL is a non about:reader URL
+     * 2. the input URL is an invalid/unparseable about:reader URL
+     */
     public static String stripAboutReaderUrl(String url) {
         if (!AboutPages.isAboutReader(url)) {
             return url;
         }
 
         final String strippedUrl = getUrlFromAboutReader(url);
         return strippedUrl != null ? strippedUrl : url;
     }