RESOLVED FIXED Bug 46743
Event dispatching in XMLHttpRequestProgressEventThrottle should go through XMLHttpRequestProgressEventThrottle::dispatchEvent
https://bugs.webkit.org/show_bug.cgi?id=46743
Summary Event dispatching in XMLHttpRequestProgressEventThrottle should go through XM...
Anton D'Auria
Reported 2010-09-28 11:57:17 PDT
In XMLHttpRequestProgressEventThrottle, we should dispatch events through XMLHttpRequestProgressEventThrottle::dispatchEvents, instead of calling m_target->dispatchEvent in various places. This makes it easy to add multiple event queuing (currently, one progress event can be queued on suspend(), if progress events have been throttled).
Attachments
[PATCH] Refactor XMLHttpRequestProgressEventThrottle event dispatching (1.89 KB, patch)
2010-09-28 12:03 PDT, Anton D'Auria
no flags
[PATCH] Refactor XMLHttpRequestProgressEventThrottle event dispatching (with ChangeLog) (3.40 KB, patch)
2010-09-28 12:41 PDT, Anton D'Auria
no flags
Patch (5.23 KB, patch)
2012-03-21 12:17 PDT, Allan Sandfeld Jensen
jchaffraix: review+
jchaffraix: commit-queue-
Patch for landing (5.65 KB, patch)
2012-03-22 08:06 PDT, Allan Sandfeld Jensen
no flags
Anton D'Auria
Comment 1 2010-09-28 12:03:38 PDT
Created attachment 69081 [details] [PATCH] Refactor XMLHttpRequestProgressEventThrottle event dispatching In preparation for platform-specific queuing of XMLHttpRequest events, this patch changes all calls to m_target->dispatchEvent to XMLHttpRequestProgressEventThrottle::dispatchEvent. Currently, we queue up only a progress event on suspend() if we have throttled progress events. We should be able to queue all XHR events that can be generated after suspend(), if the platform network layer continues to receive data. XMLHttpRequest uses XMLHttpRequestProgressEventThrottle to dispatch only download events, so this doesn't change behavior of upload events, which aren't throttled or queued.
Anton D'Auria
Comment 2 2010-09-28 12:41:19 PDT
Created attachment 69088 [details] [PATCH] Refactor XMLHttpRequestProgressEventThrottle event dispatching (with ChangeLog) Added ChangeLog
Alexey Proskuryakov
Comment 3 2010-09-28 19:49:05 PDT
I still question the need to queue multiple events in XMLHttpRequest.
Alexey Proskuryakov
Comment 4 2010-09-30 08:55:30 PDT
This makes control flow a little confusing. If XMLHttpRequestProgressEventThrottle::dispatchEvent() is called with FlushProgressEvent action, it will call flushProgressEvent(), which will now call XMLHttpRequestProgressEventThrottle::dispatchEvent() back recursively.
Darin Adler
Comment 5 2010-10-13 17:09:16 PDT
Comment on attachment 69088 [details] [PATCH] Refactor XMLHttpRequestProgressEventThrottle event dispatching (with ChangeLog) I do not like the ProgressEventAction design here. It seems if we want to do two things we should call two functions, or we can have a function that does two things, but having function with a passed parameter that tells it to either do two things or one thing seems unnecessarily confusing.
Darin Adler
Comment 6 2010-10-13 17:09:51 PDT
(In reply to comment #4) > This makes control flow a little confusing. If XMLHttpRequestProgressEventThrottle::dispatchEvent() is called with FlushProgressEvent action, it will call flushProgressEvent(), which will now call XMLHttpRequestProgressEventThrottle::dispatchEvent() back recursively. I agree that it makes the control flow confusing. Despite that, I said review+. My ProgressEventAction comment might help, though.
Darin Adler
Comment 7 2010-10-13 17:10:15 PDT
Alexey, if you had said review- I would not have done a review+. I didn’t notice your comments until afterward.
Alexey Proskuryakov
Comment 8 2010-10-13 17:17:49 PDT
Comment on attachment 69088 [details] [PATCH] Refactor XMLHttpRequestProgressEventThrottle event dispatching (with ChangeLog) My understanding is that Anton wanted to look into whether the change was needed for his project again, so I'll set cq- for now. Please feel free to flip it back if necessary.
Eric Seidel (no email)
Comment 9 2010-12-14 15:14:52 PST
Ping? Should this bug be closed or is this still for landing?
Eric Seidel (no email)
Comment 10 2010-12-20 22:59:17 PST
Looks like this was never landed. I expect the patch has rotten by now.
Allan Sandfeld Jensen
Comment 11 2012-03-21 12:17:19 PDT
Julien Chaffraix
Comment 12 2012-03-22 07:39:06 PDT
Comment on attachment 133091 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=133091&action=review > Source/WebCore/ChangeLog:8 > + Please add some details about your change and most importantly *why* you are doing it (as a stepping stone to implement event queuing in XMLHttpRequestProgressEventThrottle). The original ChangeLog had a very nice description: In preparation for platform-specific queuing of XMLHttpRequest events, this patch changes all calls to m_target->dispatchEvent to XMLHttpRequestProgressEventThrottle::dispatchEvent. Currently, we queue up only a progress event on suspend() if we have throttled progress events. We should be able to queue all XHR events that can be generated after suspend(), if the platform network layer continues to receive data. XMLHttpRequest uses XMLHttpRequestProgressEventThrottle to dispatch only download events, so this doesn't change behavior of upload events, which aren't throttled or queued.
Allan Sandfeld Jensen
Comment 13 2012-03-22 08:06:04 PDT
Created attachment 133265 [details] Patch for landing
WebKit Review Bot
Comment 14 2012-03-22 10:02:03 PDT
Comment on attachment 133265 [details] Patch for landing Clearing flags on attachment: 133265 Committed r111717: <http://trac.webkit.org/changeset/111717>
WebKit Review Bot
Comment 15 2012-03-22 10:02:08 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.