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

--HG--
extra : transplant_source : %A4%AE/%F5%00P%89%95N%033%F3%C6%0E%98%A4%8A%9F%B6%2A
This commit is contained in:
Jan Henning 2016-04-23 20:08:58 +02:00
parent 8968ec7154
commit 08568edccd

View File

@ -1452,6 +1452,22 @@ public abstract class GeckoApp
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;
@ -1461,16 +1477,9 @@ public abstract class GeckoApp
final SafeIntent intent = new SafeIntent(getIntent());
final String action = intent.getAction();
final String uri = getURIFromIntent(intent);
final String passedUri = getIntentURI(intent);
final String passedUri;
if (!TextUtils.isEmpty(uri)) {
passedUri = uri;
} else {
passedUri = null;
}
final boolean isExternalURL = passedUri != null && !AboutPages.isAboutHome(passedUri);
final boolean isExternalURL = invokedWithExternalURL(passedUri);
// Start migrating as early as possible, can do this in
// parallel with Gecko load.