Closed Bug 1637159 Opened 2 years ago Closed 2 years ago

remove public DOMEventTargetHelper::BindToOwner() rebind methods


(Core :: DOM: Events, task)




Tracking Status
firefox78 --- fixed


(Reporter: karlt, Assigned: karlt)




(6 files)

DOMEventTargetHelper::BindToOwner() documentation says that it "is only called on rebind", but

  1. Rebinding is never performed, and
  2. It is called for cases that are not rebinds. introduced the BindToOwner() methods, including support for rebinding to a different window, but all of the call sites seem to have bound a new object. for added invocations of BindToOwner() from nsGlobalWindowOuter::SetNewDocument().
At that revision also, all other calls seem to be on new objects. moved BindToOwner() calls from SetNewDocument() to nsGlobalWindowInner::MigrateStateForDocumentOpen(). said
"Note, my hope is that one day we can implement bug 1449992 and this entire mechanism can go away." introduced the documentation. removed MigrateStateForDocumentOpen().

BindToOwner() is now unnecessary as all remaining uses can be covered by passing the relevant object to the DOMEventTargetHelper constructor.

See Also: → 1625372
Severity: -- → S3

WorkerGlobalScopeBase has no override for BindToOwner(), so there is no need
for the virtual call.

The DOMEventTargetHelper(nsIGlobalObject*) constructor is not suitable here
because the nsIGlobalObject would not have been constructed when the
DOMEventTargetHelper constructor would need it.

Depends on D75037

This method can be and is used by derived classes as well as DOMEventTargetHelper
itself, so it does not need to be "Internal".

Pushed by
specify DOMEventTargetHelper owner for IDBFileHandle via constructor r=smaug
provide XMLHttpRequest owner via DOMEventTargetHelper constructor r=smaug
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
Pushed by
use BindToOwnerInternal() from WorkerGlobalScopeBase r=smaug
remove now-unused public DOMEventTargetHelper::BindToOwner() rebind methods r=smaug
remove unused unbind code from BindToOwnerInternal() r=smaug
rename BindToOwnerInternal() to BindToOwner() r=smaug
See Also: → 1642849
See Also: 1625372
You need to log in before you can comment on or make changes to this bug.