sdk/content/mod.js causes unsafe CPOW usage warnings

RESOLVED INCOMPLETE

Status

Add-on SDK
General
P1
normal
RESOLVED INCOMPLETE
3 years ago
a month ago

People

(Reporter: mconley, Unassigned)

Tracking

(Blocks: 2 bugs)

unspecified
x86
Mac OS X
Dependency tree / graph

Firefox Tracking Flags

(e10s+)

Details

(Whiteboard: [unsafe-cpow-usage])

function attach(modification, target) {
  if (!modification)
    return;

  let window = getTargetWindow(target);

  attachTo(modification, window);

  // modification are stored per content; `window` reference can still be the
  // same even if the content is changed, therefore `document` is used instead.
  add(modification, window.document); <-- window.document causes unsafe CPOW usage when window is a CPOW
}



function detach(modification, target) {
  if (!modification)
    return;

  if (target) {
    let window = getTargetWindow(target);
    detachFrom(modification, window);
    remove(modification, window.document); <-- window.document causes unsafe CPOW usage when window is a CPOW
  }
  else {
    let documents = iterator(modification);
    for (let document of documents) {
      let window = document.defaultView;
      // The window might have already gone away
      if (!window)
        continue;
      detachFrom(modification, document.defaultView);
      remove(modification, document);
    }
  }
}
Blocks: 1004745, 902217
Priority: -- → P1
tracking-e10s: m8+ → ---
Whiteboard: [unsafe-cpow-usage]
content/mod is a module that can be used by both the SDK and by add-ons code, and is not cpow-safe.
tracking-e10s: --- → ?
Assignee: nobody → wmccloskey
tracking-e10s: ? → +
tracking-e10s: + → ?
tracking-e10s: ? → +
Our current promise is that high level APIs are e10s ready, but this one is relying on shims and can cause unsafe CPOW usage. Should we block on this?
tracking-e10s: + → ?
tracking-e10s: ? → m9+
tracking-e10s: m9+ → +
Assignee: wmccloskey → nobody
https://bugzilla.mozilla.org/show_bug.cgi?id=1399562
Status: NEW → RESOLVED
Last Resolved: a month ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.