Closed Bug 1397232 Opened 7 years ago Closed 7 years ago

nsBrowserGlue.js, line 952: TypeError: win is null (_sendMediaTelemetry)

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 57
Tracking Status
firefox57 --- fixed

People

(Reporter: florian, Assigned: Felipe)

References

Details

Attachments

(1 file)

_sendMediaTelemetry now runs from an idle callback started off _scheduleArbitrarilyLateIdleTasks, and can run at a time when there's no browser window, which means RecentWindow.getMostRecentBrowserWindow() can return null.
Assignee: nobody → felipc
Status: NEW → ASSIGNED
Comment on attachment 8905242 [details]
Bug 1397232 - Use the hidden window to report media telemetry.

I discussed this with Felipe yesterday over IRC. I don't think silencing the error and silently failing to collect telemetry data is a good idea. From our discussion, it seems the best path forward is to avoid using RecentWindow.jsm, and instead use the hidden window.
Attachment #8905242 - Flags: review?(florian)
Attachment #8905242 - Flags: review?(cpearce)
Comment on attachment 8905242 [details]
Bug 1397232 - Use the hidden window to report media telemetry.

https://reviewboard.mozilla.org/r/177032/#review182474

::: browser/components/nsBrowserGlue.js:952
(Diff revision 2)
>      this._firstWindowLoaded();
>    },
>  
>    _sendMediaTelemetry() {
> -    let win = RecentWindow.getMostRecentBrowserWindow();
> +    let win = Services.appShell.hiddenDOMWindow;
> +    if (win) {

I don't think we need this null check when using the hidden window. I guess it's a leftover from the previous version of the patch.
Comment on attachment 8905242 [details]
Bug 1397232 - Use the hidden window to report media telemetry.

https://reviewboard.mozilla.org/r/177032/#review182890

LGTM
Attachment #8905242 - Flags: review?(florian) → review+
Pushed by felipc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/4f3ba0330ce0
Use the hidden window to report media telemetry. r=florian
https://hg.mozilla.org/mozilla-central/rev/4f3ba0330ce0
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 57
You need to log in before you can comment on or make changes to this bug.