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?
http://mxr.mozilla.org/mozilla-central/source/dom/ipc/ContentChild.cpp#195 shows no window ID being sent. This looks like it should be an easy fix to me. http://mxr.mozilla.org/mozilla-central/source/dom/ipc/PContent.ipdl#330 http://mxr.mozilla.org/mozilla-central/source/dom/ipc/ContentParent.cpp#1886
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.
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!)
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.
(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.
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.