[webkit-dev] Is ActiveDOMObject::scriptExecutionContext virtual or not?

Takashi Toyoshima toyoshim at chromium.org
Tue Apr 19 21:40:55 PDT 2011

Hi, guys.

I understand.
WebSocket also inherits EventTarget, and scriptExecutionContext
is defined as virtual in EventTarget.

Sorry for bothering you.

On Tue, Apr 19, 2011 at 11:30 AM, Takashi Toyoshima
<toyoshim at chromium.org> wrote:
> Hi, webkit guys.
> I have a question on ActiveDOMObject::scriptExecutionContext().
> Now is was defined as non-virtual function. But currently, half of
> its inheritors defined this function as virtual.
> In my understanding, this virtual could not work because it's defined
> as non-virtual in its super class. Of course if they had its inheritors itself,
> it could work under their class context, but it doesn't as ActiveDOMObject.
> For example, WebSocket inherits ActiveDOMObject and define
> scriptExecutionContext as virtual function. But its implementation is
> just calling ActiveDOMObject::scriptExecutionContext and returning
> its result. It has no inheritor.
> Could I think it's a dead code or never used one?
> Does anyone know some historical or technical reason for that?
> Thanks,

More information about the webkit-dev mailing list