Bug 1297117 - Add documentation to stripAboutReaderUrl r=sebastian
authorAndrzej Hunt <ahunt@mozilla.com>
Fri, 02 Sep 2016 12:35:47 -0700
changeset 312657 b9de26cf8806eaf7a35b7210fb117e07e479154d
parent 312656 fa498a368de326969bcd2c87cae1452522f8513d
child 312718 8c8d47b20849c70874f08f4c27e6c157e7f5e01a
push id20457
push userahunt@mozilla.com
push dateMon, 05 Sep 2016 19:58:11 +0000
treeherderfx-team@b9de26cf8806 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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;
     }