Closed Bug 1647359 Opened 4 years ago Closed 4 years ago

Change object definitions in SearchEngine.jsm to be classes

Categories

(Firefox :: Search, task, P1)

task
Points:
3

Tracking

()

RESOLVED FIXED
Firefox 80
Iteration:
80.1 - June 29 - July 12
Tracking Status
firefox80 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(3 files)

In bug 1637744, I want to split SearchEngine into several objects which all extend from a central SearchEngine class. This will help with finding relevant functionality as well as making the core SearchEngine class less complex.

This first step is to change the existing objects into classes. There's a little fallout as preferences tries to iterate the fields of the engine objects to clone them, however with the engine objects as classes, the XPCOM interface fields don't get added, so preferences fails.

The good news is that preferences actually only needs three fields - cloning the rest is a waste of time and memory.

Try push:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=0fab9a51015e6a571e8925389ca58e452bf86759

The clones appear to be so that access for the tree view in preferences is quick. However, they don't need to clone the entire engine object - they just need three fields.

Additionally, this fixes reloading icons which was attempting to use 'uri' but that isn't defined, and so icons would fail to load if preferences was opened when a search engine is added.

It shouldn't cause an issue, but I'll land this set after soft freeze.

Iteration: 78.2 - May 18 - May 31 → 79.1 - June 1 - June 14
Iteration: 79.1 - June 1 - June 14 → 80.1 - June 29 - July 12
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/65c58515f2cb
Preferences should only clone the parts of the search engine objects that it actually needs. r=jaws,preferences-reviewers
https://hg.mozilla.org/integration/autoland/rev/b39278706c66
Change definitions in SearchEngine to be classes. r=daleharvey
https://hg.mozilla.org/integration/autoland/rev/fdf086cfd0f9
Move SearchEngine fields to start of class for better clarity and documentation. r=daleharvey
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2c12d4e78a4a
Preferences should only clone the parts of the search engine objects that it actually needs. r=jaws,preferences-reviewers
https://hg.mozilla.org/integration/autoland/rev/d0a32a3b7e6c
Change definitions in SearchEngine to be classes. r=daleharvey
https://hg.mozilla.org/integration/autoland/rev/e1d659582192
Move SearchEngine fields to start of class for better clarity and documentation. r=daleharvey
Regressions: 1654246
You need to log in before you can comment on or make changes to this bug.