Closed Bug 1263935 Opened 8 years ago Closed 8 years ago

Many "JavaScript warning: .../map-uri-to-addon-id.js, line 53: DebuggeeWouldRun: debuggee `.../addonManager.j" when opening the browser toolbox

Categories

(DevTools :: Debugger, defect, P2)

defect

Tracking

(firefox49 fixed)

RESOLVED FIXED
Firefox 49
Tracking Status
firefox49 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

Details

Attachments

(3 files, 3 obsolete files)

It slows down the toolbox opening as these warnings are displayed in the browser toolbox's console. Also it highlights cases where we could potentially step into DebuggerServer dependencies. AddonManager modules (js xpcom and jsms) are not flagged as "invisible to debugger". Only modules loaded via devtools loader are.
(see bug 1263629 for similar issue with Promises)

I see multiple options here. We could:
* reduce as much as possible the call to this AddonManager dependency. Like not calling it for any known to be builtin URL (chrome://browser/, resource://gre, ...) But we will still leak a few calls...
* tweak AddonPathService to also expose mapURIToAddonId and used this native module rather than AddonManager js module.

The second option involve a c++ platform patch, but sounds great. It should also be faster...
Mossop, It would help devtools if we could use this native version of mapURIToAddonId.
So I'm suggesting here to expose it via the idl.
Then I have a set of patch to use that instead of the duplicated js version from xpiprovider.jsm.
Attachment #8741037 - Flags: review?(dtownsend)
Attachment #8740461 - Attachment is obsolete: true
If you agree with previous patch, here is an optional cleanup to be done in AddonManager.
Also. Since this method seems to be only used by devtools code...
May be we could just drop this mapURIToAddonId and use the c++ service from devtools
(which I'm planning to do in the last patch).
Attachment #8741047 - Flags: review?(dtownsend)
Attachment #8740462 - Attachment is obsolete: true
Waiting for mossop feedback before proceeding with devtools patch.
Attachment #8740463 - Attachment is obsolete: true
Attachment #8741037 - Flags: review?(dtownsend) → review+
Attachment #8741047 - Flags: review?(dtownsend) → review+
Comment on attachment 8741048 [details] [diff] [review]
Use AddonPathService.mapURIToAddonId instead of AddonManager.mapURIToAddonID - v1

I also made a small optimisation by moving the "if (b2g)" on top level instead of within mapURIToAddonId so that we do the check only once.
And I changed the function arguments. It no longer uses an "id" argument and instead just returns the id.
Attachment #8741048 - Flags: review?(ejpbruel)
Priority: -- → P2
Comment on attachment 8741048 [details] [diff] [review]
Use AddonPathService.mapURIToAddonId instead of AddonManager.mapURIToAddonID - v1

Review of attachment 8741048 [details] [diff] [review]:
-----------------------------------------------------------------

I have no comments for a change :-P Go ahead and land this :-)
Attachment #8741048 - Flags: review?(ejpbruel) → review+
https://hg.mozilla.org/integration/fx-team/rev/f171ce6678d567464ba0c40193a41561c746d76b
Bug 1263935 - Expose native version of mapURIToAddonId via amIAddonPathService. r=mossop

https://hg.mozilla.org/integration/fx-team/rev/27290170d6e06a85def4656e61582b63ab117a22
Bug 1263935 - Forward AddonManager.mapURIToAddonId to AddonPathService.mapURIToAddonId. r=mossop

https://hg.mozilla.org/integration/fx-team/rev/6a441b2b2997cdbd47b5d80283f6f60d5a9e7489
Bug 1263935 - Use AddonPathService.mapURIToAddonId instead of AddonManager.mapURIToAddonID. r=ejpbruel
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: