Closed Bug 1644992 Opened 5 years ago Closed 5 years ago

JSWindowActorProtocol::Observe should report a browser console error / warning if the subject isn't an inner/outer window

Categories

(Core :: DOM: Content Processes, defect, P3)

defect

Tracking

()

RESOLVED FIXED
82 Branch
Fission Milestone M6c
Tracking Status
firefox82 --- fixed

People

(Reporter: Gijs, Assigned: nika)

Details

Attachments

(1 file, 1 obsolete file)

Current code is:

  nsCOMPtr<nsPIDOMWindowInner> inner = do_QueryInterface(aSubject);
  RefPtr<WindowGlobalChild> wgc;

  if (!inner) {
    nsCOMPtr<nsPIDOMWindowOuter> outer = do_QueryInterface(aSubject);
    if (NS_WARN_IF(!outer) || NS_WARN_IF(!outer->GetCurrentInnerWindow())) {
      return NS_ERROR_FAILURE;
    }
    wgc = outer->GetCurrentInnerWindow()->GetWindowGlobalChild();
  } else {
    wgc = inner->GetWindowGlobalChild();
  }

  if (NS_WARN_IF(!wgc)) {
    return NS_ERROR_FAILURE;
  }

The observer service will swallow the NS_ERROR_FAILURE, so failure is mostly silent except on debug builds, where I think warnings are likely to get lost in the rest of the stdout/stderr maelstrom.

I think we should report an error in the console service with the actor name and observer topic, so we're more likely to notice / understand why the observer interaction with the child actor "doesn't work".

This is a feature request from Frontend team.

Tracking for Fission Nightly M6b

Severity: -- → S3
Fission Milestone: --- → M6b
Priority: -- → P3
Attached file Bug 1644992 (obsolete) —
Fission Milestone: M6b → M6c
Assignee: nobody → nika
Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/886855bf6308 Report an error for non-window topic observed by JSWindowActorProtocol, r=kmag
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 82 Branch
Attachment #9163827 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: