Bug 78302 - [ActiveDOMObject] attribute should be inherited
Summary: [ActiveDOMObject] attribute should be inherited
Status: RESOLVED DUPLICATE of bug 107877
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-09 17:54 PST by Kentaro Hara
Modified: 2013-01-30 00:47 PST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-02-09 17:54:24 PST
If interface B inherits interface A and interface A has [ActiveDOMObject], then interface B should have [ActiveDOMObject].
Comment 1 Adam Barth 2012-02-09 18:05:41 PST
Isn't any case where we don't do this a bug because the wrappers get GCed too early?
Comment 2 Kentaro Hara 2012-02-09 18:16:24 PST
I searched the code base and confirmed that DedicatedWorkerContext and SharedWorkerContext are the only interfaces that do not have [ActiveDOMObject] but inherit an interface with [ActiveDOMObject].

I agree that this would be a bug. Though I am not familiar with workers and have not yet written tests which causes the bug.
Comment 3 Adam Barth 2012-02-09 18:21:04 PST
It might be hard to write such a test because code running in workers can only see one global object and any function would retain its global object by another means.
Comment 4 Kentaro Hara 2012-02-09 18:23:55 PST
(In reply to comment #3)
> It might be hard to write such a test because code running in workers can only see one global object and any function would retain its global object by another means.

Thanks! Then is it OK to add [ActiveDOMObject] to DedicatedWorkerContext and SharedWorkerContext without tests? (After that patch is landed, I can work on IDL attribute inheritance if needed.)
Comment 5 Adam Barth 2012-02-09 18:41:41 PST
Sounds like a good plan.
Comment 6 Kentaro Hara 2012-02-10 05:54:13 PST
(In reply to comment #2)
> I searched the code base and confirmed that DedicatedWorkerContext and SharedWorkerContext are the only interfaces that do not have [ActiveDOMObject] but inherit an interface with [ActiveDOMObject].

Correction: I confirmed that all interfaces which inherits an [ActiveDOMObject] interface has [ActiveDOMObject].

(Nit: "grep -r ': Worker' *" told me DedicatedWorkerContext and SharedWorkerContext, and I thought that they inherit Worker. But actually they inherit WorkerContext:-)
Comment 7 Darin Adler 2012-02-13 15:40:49 PST
The only reason we don’t do this already is that interface generation never involves reading the IDL of base classes. So mechanically there is no straightforward way to do inheritance.

The concept of inheriting automatically seems fine. The real issue is just the mechanics of how we’d compile IDLs to accomplish this. I think it would be even better to not need [ActiveDOMObject] at all; maybe there’s a compile time trick we can do with templates or something like that to automatically figure out if the implementation class derives from ActiveDOMObject.
Comment 8 Kentaro Hara 2013-01-30 00:47:14 PST

*** This bug has been marked as a duplicate of bug 107877 ***