Closed Bug 950315 Opened 11 years ago Closed 10 years ago

Make more nsDOMEventTargetHelper subclasses use auto-binding constructors

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

(Whiteboard: [qa-])

Attachments

(2 files, 6 obsolete files)

10.36 KB, patch
khuey
: review+
Details | Diff | Splinter Review
55.69 KB, patch
smaug
: review+
Details | Diff | Splinter Review
I was actually doing this because I wanted to hunt down which DETH subclasses were not on WebIDL, but this was a convenient way to do that.

This doesn't convert everything; for one thing on workers we don't BindToOwner.
Depends on: 950188
Attachment #8347570 - Attachment is obsolete: true
Attachment #8347570 - Flags: review?(bugs)
Attachment #8347571 - Attachment is obsolete: true
Attachment #8347571 - Flags: review?(khuey)
Comment on attachment 8347572 [details] [diff] [review]
part 1.  Convert a bunch of event targets to passing a Window or nsDOMEventTargetHelper directly to the constructor of their ancestor nsDOMEventTargetHelper.

Review of attachment 8347572 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/base/src/nsDOMDataChannel.cpp
@@ +82,5 @@
>  
> +nsDOMDataChannel::nsDOMDataChannel(already_AddRefed<mozilla::DataChannel> aDataChannel,
> +                                   nsPIDOMWindow* aWindow)
> +  : nsDOMEventTargetHelper(aWindow && aWindow->IsOuterWindow() ?
> +                             aWindow->GetCurrentInnerWindow() : aWindow)

Ugh. Followup to decide which kind of window we get here?

::: dom/devicestorage/nsDeviceStorage.cpp
@@ +2703,5 @@
>    if (NS_FAILED(ds->Init(aWin, aType, storageName))) {
>      *aStore = nullptr;
>      return;
>    }
>    NS_ADDREF(*aStore = ds.get());

Feel free to make this ds.forget(aStore) while you're around :)
Attachment #8347572 - Attachment is obsolete: true
Attachment #8347572 - Flags: review?(bugs)
Attachment #8347699 - Attachment is obsolete: true
Attachment #8347699 - Flags: review?(bugs)
Attachment #8347700 - Attachment is obsolete: true
Attachment #8347700 - Flags: review?(bugs)
Attachment #8347701 - Attachment is obsolete: true
Attachment #8347701 - Flags: review?(bugs)
Comment on attachment 8347702 [details] [diff] [review]
part 1.  Convert a bunch of event targets to passing a Window or nsDOMEventTargetHelper directly to the constructor of their ancestor nsDOMEventTargetHelper.

Could you add an assertion to 
nsDOMEventTargetHelper::BindToOwner(nsPIDOMWindow* aOwner) that only inner window is passed there,
well perhaps MOZ_ASSERT(!aOwner || aOwner->IsInnerWindow());


And looks like all the changes are for stuff implementing webidl interfaces so SetIsDOMBinding
in DETH ctor is ok.
Attachment #8347702 - Flags: review?(bugs) → review+
> And looks like all the changes are for stuff implementing webidl interfaces

Yes, I carefully avoided the others.

I added the assert; will see how try likes it.
> Ugh. Followup to decide which kind of window we get here?

Filed bug 957027.
Whiteboard: [qa-]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: