Closed Bug 1801621 Opened 2 years ago Closed 2 years ago

Remove unused code from source-map-loader codebase

Categories

(DevTools :: Debugger, task)

task

Tracking

(firefox109 fixed)

RESOLVED FIXED
109 Branch
Tracking Status
firefox109 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

getAllGeneratedLocations isn't used by devtools/debugger:
https://searchfox.org/mozilla-central/search?q=selectSource%28&path=debugger&case=false&regexp=false

Also setAssetRootURL could be removed now that the URL of wasm file is fixed:
https://searchfox.org/mozilla-central/search?q=getAllGeneratedLocations&path=devtools&case=false&regexp=false

The usage of WorkerDispatcher is not the most performant.
Ideally we shouldn't use WorkerDispatcher.invoke as it recreate a non trivial method each time we call it. Instead we should be using WorkerDispatcher.task:
https://searchfox.org/mozilla-central/rev/83b86005c6913c2062419efb8aabdf2e683aa47f/devtools/client/shared/worker-utils.js#35-74

The createConsumer module looks useless now.
https://searchfox.org/mozilla-central/source/devtools/client/shared/source-map-loader/utils/createConsumer.js

While I'm doing some cleanup, some jsdoc may be helpful here and there.

Instead we could always load the wasm file when the modules are loaded.

WorkerDispatcher.invoke will instantiate a new "Task" method on each call.
Ideally, we should only use WorkerDispatch.task(), unless the related method is called once.

Blocks: 1801695
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fc0821b24947 [devtools] Remove asset root setters. r=bomsy https://hg.mozilla.org/integration/autoland/rev/5fd0a8755149 [devtools] Remove unused getAllGeneratedLocations. r=bomsy https://hg.mozilla.org/integration/autoland/rev/f4404985a73f [devtools] Avoid creating WorkerDispatch task on each worker method call. r=bomsy https://hg.mozilla.org/integration/autoland/rev/8f14e58a69ef [devtools] Remove useless createConsumer intermediate module. r=bomsy https://hg.mozilla.org/integration/autoland/rev/4da1d585bdd4 [devtools] Document source map requests module. r=bomsy
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: