nsIScriptError window ID is missing for errors coming from content processes

RESOLVED INACTIVE

Status

()

Core
XPConnect
RESOLVED INACTIVE
6 years ago
2 months ago

People

(Reporter: msucan, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
If a document loaded in a content process has a JS error (or any other kind of error), the associated nsIScriptError lacks the inner and outer window IDs.

The nsIConsoleListener lives in the main process.

Is there a way we can have fix for this issue?

We would need this for bug 802246.
The whole point of numeric window IDs was that we would be able to ship them cross-process and use the combination of window id and process id to identify things.  Why are we not doing that?

Comment 3

6 years ago
I have a recollection of the implementation of this coming up once in the past, but can't find any discussion about it. Anyways, when I wrote the cross-process code the window IDs didn't exist on the script error objects.
(Reporter)

Comment 4

6 years ago
Created attachment 672907 [details] [diff] [review]
quick patch

I just played quickly with the code you pointed us to.

I added inner window IDs to the nsIScriptErrors, but initWithWindowID() only provides support for giving the inner window ID. The outer ID is determined in the initialization function. That fails (as I expected), so nsIScriptErrors only carry the inner ID to the parent, for now.

To fix that, should I add a SetOuterWindowID() to nsScriptError? or add an optional argument to initWithWindowID() so we can pass the outer ID as well?

Once we have the IDs in the parent process, for every nsIScriptError, would they match their respective windows? I mean, are these IDs global for all content processes started by the parent process? (how does this work?)

(sorry for asking all of these questions - consider me a beginner in this stuff - I like to play with and learn from Gecko code. thank you!)
Attachment #672907 - Flags: feedback?(josh)

Comment 5

6 years ago
My suspicion is that IDs won't be unique across multiple processes right now; perhaps we need to attach a PID or app ID to script errors in the parent as well. I'm not sure of the proper way to integrate the outer windows in the parent process; I'll defer that decision to Someone Else.

Updated

6 years ago
Attachment #672907 - Flags: feedback?(josh)
(In reply to Josh Matthews [:jdm] from comment #5)
> My suspicion is that IDs won't be unique across multiple processes right
> now; perhaps we need to attach a PID or app ID to script errors in the
> parent as well. I'm not sure of the proper way to integrate the outer
> windows in the parent process; I'll defer that decision to Someone Else.

I believe that is precisely what Chris Jones was suggesting as well in bug 802246 comment 3.

Comment 7

2 months ago
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.