Bug 1529367 - Part 2: Minor intent processing optimisation. r=snorp
authorJan Henning <jh+bugzilla@buttercookie.de>
Tue, 26 Feb 2019 14:54:27 +0000
changeset 519077 5d81bc61dfb82e34be9517420f90aa93910d42ab
parent 519076 cd6d699aabde2bb4c4b6d1e70682549e5dc9dcb7
child 519078 1165806614a45faf998da7ffe8f670e94a5f9030
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp
bugs1529367
milestone67.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 1529367 - Part 2: Minor intent processing optimisation. r=snorp The extension is only ever used for local files, so don't bother retrieving it otherwise. Differential Revision: https://phabricator.services.mozilla.com/D21049
mobile/android/base/java/org/mozilla/gecko/IntentHelper.java
--- a/mobile/android/base/java/org/mozilla/gecko/IntentHelper.java
+++ b/mobile/android/base/java/org/mozilla/gecko/IntentHelper.java
@@ -337,22 +337,22 @@ public final class IntentHelper implemen
         if ("intent".equals(scheme) || "android-app".equals(scheme)) {
             return IntentUtils.getSafeIntent(uri);
         }
 
         // Compute our most likely intent, then check to see if there are any
         // custom handlers that would apply.
         // Start with the original URI. If we end up modifying it, we'll
         // overwrite it.
-        final String extension = MimeTypeMap.getFileExtensionFromUrl(targetURI);
         final Intent intent = getIntentForActionString(action);
         intent.setData(uri);
 
         if ("file".equals(scheme)) {
             // Only set explicit mimeTypes on file://.
+            final String extension = MimeTypeMap.getFileExtensionFromUrl(targetURI);
             final String mimeType2 = GeckoAppShell.getMimeTypeFromExtension(extension);
             intent.setType(mimeType2);
             return intent;
         }
 
         // Have a special handling for SMS based schemes, as the query parameters
         // are not extracted from the URI automatically.
         if (!"sms".equals(scheme) && !"smsto".equals(scheme) && !"mms".equals(scheme) && !"mmsto".equals(scheme)) {