Bug 905223 - Part 1 - Factor out external URL calculation. r=margaret
authorJan Henning <jh+bugzilla@buttercookie.de>
Sat, 23 Apr 2016 20:08:58 +0200
changeset 340509 5fc62e209fc7c7dd276f1cfd2830e7fe5f7721fa
parent 340508 17386d25f2603d769aa169f5d9719b03a1387005
child 340510 d4f569803fec76b17f4f5371415c45ad1a202bf8
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmargaret
bugs905223
milestone49.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 905223 - Part 1 - Factor out external URL calculation. r=margaret For session data parsing, we need to know whether we were invoked with an external URL or not. Since we want to move session data parsing forward to an earlier point in time, but also continue needing that external URL info during initialize() as well, we'll factor out those calculations into their own functions which can then be called from both places. MozReview-Commit-ID: HFlT8uxC9yz
mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -1447,35 +1447,44 @@ public abstract class GeckoApp
 
         Tabs.getInstance().loadUrlWithIntentExtras(url, intent, flags);
     }
 
     public String getHomepage() {
         return null;
     }
 
+    private String getIntentURI(SafeIntent intent) {
+        final String passedUri;
+        final String uri = getURIFromIntent(intent);
+
+        if (!TextUtils.isEmpty(uri)) {
+            passedUri = uri;
+        } else {
+            passedUri = null;
+        }
+        return passedUri;
+    }
+
+    private boolean invokedWithExternalURL(String uri) {
+        return uri != null && !AboutPages.isAboutHome(uri);
+    }
+
     private void initialize() {
         mInitialized = true;
 
         final boolean isFirstTab = !mWasFirstTabShownAfterActivityUnhidden;
         mWasFirstTabShownAfterActivityUnhidden = true; // Reset since we'll be loading a tab.
 
         final SafeIntent intent = new SafeIntent(getIntent());
         final String action = intent.getAction();
 
-        final String uri = getURIFromIntent(intent);
-
-        final String passedUri;
-        if (!TextUtils.isEmpty(uri)) {
-            passedUri = uri;
-        } else {
-            passedUri = null;
-        }
-
-        final boolean isExternalURL = passedUri != null && !AboutPages.isAboutHome(passedUri);
+        final String passedUri = getIntentURI(intent);
+
+        final boolean isExternalURL = invokedWithExternalURL(passedUri);
 
         // Start migrating as early as possible, can do this in
         // parallel with Gecko load.
         checkMigrateProfile();
 
         Tabs.registerOnTabsChangedListener(this);
 
         initializeChrome();