Closed
Bug 1121318
Opened 10 years ago
Closed 10 years ago
HelperApps.getAppsForUri should ignore well-known internal schemes
Categories
(Firefox for Android Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 38
People
(Reporter: mfinkle, Assigned: mfinkle)
Details
(Keywords: perf)
Attachments
(2 files)
2.35 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
1.00 KB,
patch
|
rnewman
:
review+
|
Details | Diff | Splinter Review |
I think we can ignore "about:" and "chrome:" URI schemes and just return empty arrays. This saves ~60ms in Gecko and two Messaging.sendRequest in Java calls during a about:home startup.
Assignee | ||
Comment 1•10 years ago
|
||
Simple cleanup and formatting changes
Assignee: nobody → mark.finkle
Attachment #8548622 -
Flags: review?(wjohnston)
Assignee | ||
Comment 2•10 years ago
|
||
Adds a simple check for "about:" and "chrome:" and returns empty [] either directly or via the callback.
Attachment #8548623 -
Flags: review?(wjohnston)
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 3•10 years ago
|
||
I am also considering creating a simple cache to avoid Java side lookups for URIs, since many times pages with the same domain (https://twitter.com or http://google.com) are loaded and we could fast path the return of handlers.
This would assume that we don't need to hold the entire URI spec in the cache. We'd need to look at the ways Android Manifests allow URI based matching. If only the scheme and domain are needed, we could get a nice perf bump for little cache size.
Comment 4•10 years ago
|
||
Comment on attachment 8548623 [details] [diff] [review]
helper-ignore-schemes v0.1
Review of attachment 8548623 [details] [diff] [review]:
-----------------------------------------------------------------
(Assuming Wes isn't working late, and I am.)
::: mobile/android/modules/HelperApps.jsm
@@ +103,5 @@
> },
>
> getAppsForUri: function getAppsForUri(uri, flags = { }, callback) {
> + // Return early for well-known internal schemes
> + if (uri.schemeIs("about") || uri.schemeIs("chrome")) {
In an abundance of caution, because not every call site checks: add a null check to this clause.
Attachment #8548623 -
Flags: review?(wjohnston) → review+
Comment 5•10 years ago
|
||
Comment on attachment 8548622 [details] [diff] [review]
helper-cleanup v0.1 (part 0)
Review of attachment 8548622 [details] [diff] [review]:
-----------------------------------------------------------------
::: mobile/android/modules/HelperApps.jsm
@@ +177,1 @@
>
Might as well kill this trailing whitespace if you're doing cleanup.
Attachment #8548622 -
Flags: review?(wjohnston) → review+
Updated•10 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 6•10 years ago
|
||
With comments addressed:
remote: https://hg.mozilla.org/integration/fx-team/rev/7b853be9e118
remote: https://hg.mozilla.org/integration/fx-team/rev/c379987d0266
Comment 7•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7b853be9e118
https://hg.mozilla.org/mozilla-central/rev/c379987d0266
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•