[webkit-reviews] review granted: [Bug 209754] hasPendingActivity() overrides should make sure to query ActiveDOMObject::hasPendingActivity() : [Attachment 394935] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 30 13:30:33 PDT 2020


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 209754: hasPendingActivity() overrides should make sure to query
ActiveDOMObject::hasPendingActivity()
https://bugs.webkit.org/show_bug.cgi?id=209754

Attachment 394935: Patch

https://bugs.webkit.org/attachment.cgi?id=394935&action=review




--- Comment #3 from Darin Adler <darin at apple.com> ---
Comment on attachment 394935
  --> https://bugs.webkit.org/attachment.cgi?id=394935
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=394935&action=review

How did you decide when to use || and when to use a separate if instead? What
about when to do base class first and when to do the subclass first?

Could also consider a different design where the code calling
hasPendingActivity deals with the rules currently followed by
ActiveDOMObject::hasPendingActivity instead of requiring calling through to the
base class to make this mistake impossible.

> Source/WebCore/dom/MessagePort.cpp:320
> +    if (ActiveDOMObject::hasPendingActivity())
> +	   return true;

A little strange to do this after checking m_closed. Probably fine but I don’t
really understand this fully.

> Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp:5558
>  bool WebGLRenderingContextBase::hasPendingActivity() const
>  {
> -    return false;
> +    return ActiveDOMObject::hasPendingActivity();
>  }

Why does this override exist at all? I think we should remove it instead.


More information about the webkit-reviews mailing list