XMLHttpRequestProgressEventThrottle shouldn't throttle / defer progress events if...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Oct 2014 22:49:06 +0000 (22:49 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Oct 2014 22:49:06 +0000 (22:49 +0000)
commit59b5f3694fa9771a866d1ed6de761746b3268138
treec889f54d70dc0517f3a69755a8c5e43dca75612c
parentd88c87b4e133f7ebcc821f9fd2bdcc87880e5dd5
XMLHttpRequestProgressEventThrottle shouldn't throttle / defer progress events if there are no listeners
https://bugs.webkit.org/show_bug.cgi?id=137346

Reviewed by Alexey Proskuryakov.

Previously XMLHttpRequestProgressEventThrottle would throttle / defer
progress events, which involves queueing events and starting timers,
even if there were no listeners for those events (which is fairly
common case).

This patch updates XMLHttpRequestProgressEventThrottle to make sure
there are actual progress event listeners *before* attempting to
throttle and do extra processing, to avoid doing unnecessary work.

This patch also makes XMLHttpRequestProgressEventThrottle::dispatchEvent()
private as this method is only called from other dispatch methods of
the class and never from the outside.

No new tests, no behavior change.

* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174235 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp
Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.h