Closed Bug 1463652 Opened Last year Closed Last year

Lazy load the sourceMapURLService from the rule editor

Categories

(DevTools :: Inspector: Rules, enhancement, P3)

enhancement

Tracking

(firefox62 fixed)

RESOLVED FIXED
Firefox 62
Tracking Status
firefox62 --- fixed

People

(Reporter: gl, Assigned: gl)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

No description provided.
We weren't lazily loading sourceMapURLService from the toolbox before because we directly called this.toolbox.sourceMapURLService in https://searchfox.org/mozilla-central/source/devtools/client/inspector/rules/views/rule-editor.js#59, and you can see in toolbox.js that get sourceMapURLService is lazily loaded. 

This changes is to make sure we only load sourceMapURLService when we actually needed it in the rule-editor.
Comment on attachment 8979830 [details]
Bug 1463652 - Lazy load the sourceMapURLService from the rule editor.

https://reviewboard.mozilla.org/r/245998/#review252042

::: devtools/client/inspector/rules/views/rule-editor.js:105
(Diff revision 1)
> +    }
> +  },
> +
> +  get sourceMapURLService() {
> +    if (!this._sourceMapURLService) {
> +      this._sourceMapURLService = this.toolbox.sourceMapURLService;

Perhaps add a comment here that says that `this.toolbox.sourceMapURLService` is itself a lazy getter.
Otherwise, it's hard to understand why we would go through such trouble to lazily get it here too, if that service has already been initialized by the toolbox.
Attachment #8979830 - Flags: review?(pbrosset) → review+
Pushed by gabriel.luong@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/c31a27e8b51a
Lazy load the sourceMapURLService from the rule editor. r=pbro
Assignee: nobody → gl
https://hg.mozilla.org/mozilla-central/rev/c31a27e8b51a
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.