Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Issue 79953004: Improve fidelity of XHR progress events. (Closed)

Created:
7 years, 1 month ago by sof
Modified:
7 years ago
CC:
blink-reviews
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Improve fidelity of XHR progress events. When dispatching XMLHttpRequest progress events, for upload as well as normal/download, supply the required 'loaded' and 'total' properties on the events, if available, for better reporting to scripts. Previously just left as 0. The new behavior mirrors what other implementations are doing. R=tyoshino,abarth BUG=318727 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=162689

Patch Set 1 #

Total comments: 14

Patch Set 2 : Tidy up handling of the signed m_receivedLength #

Total comments: 3

Patch Set 3 : Also deliver faithful 'progress' events on request error #

Total comments: 5

Patch Set 4 : Avoid using default arguments #

Total comments: 6

Patch Set 5 : Remove unused argument defaulting #

Patch Set 6 : Avoid now-unnecessary argument defaulting #

Total comments: 29

Patch Set 7 : Tidy up tests + fix slight bug in XHR loaded/total computation. #

Patch Set 8 : Make test stable #

Unified diffs Side-by-side diffs Delta from patch set Stats (+319 lines, -152 lines) Patch
M LayoutTests/fast/xmlhttprequest/xmlhttprequest-get.xhtml View 1 2 3 4 5 6 7 2 chunks +8 lines, -3 lines 0 comments Download
M LayoutTests/fast/xmlhttprequest/xmlhttprequest-get-expected.txt View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/onload-event.html View 1 2 3 4 5 6 1 chunk +64 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/onload-event-expected.txt View 1 chunk +5 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-load.html View 1 2 3 4 5 6 1 chunk +39 lines, -36 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-load-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/ontimeout-event.html View 1 2 3 4 5 6 1 chunk +46 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/ontimeout-event-expected.txt View 1 chunk +5 lines, -0 lines 0 comments Download
A LayoutTests/http/tests/xmlhttprequest/resources/post-echo.php View 1 chunk +10 lines, -0 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/upload-onload-event.html View 1 2 3 4 5 6 1 chunk +28 lines, -28 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/upload-onload-event-expected.txt View 1 chunk +1 line, -2 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/upload-onloadend-event-after-load.html View 1 2 3 4 5 6 1 chunk +35 lines, -33 lines 0 comments Download
M LayoutTests/http/tests/xmlhttprequest/upload-onloadend-event-after-load-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.h View 1 2 3 2 chunks +9 lines, -5 lines 0 comments Download
M Source/core/xml/XMLHttpRequest.cpp View 1 2 3 4 5 6 11 chunks +48 lines, -25 lines 0 comments Download
M Source/core/xml/XMLHttpRequestProgressEventThrottle.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/xml/XMLHttpRequestProgressEventThrottle.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M Source/core/xml/XMLHttpRequestUpload.h View 1 2 3 4 5 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/xml/XMLHttpRequestUpload.cpp View 1 2 3 4 5 6 1 chunk +7 lines, -7 lines 0 comments Download

Messages

Total messages: 33 (0 generated)
sof
At your leisure, please have a look. (If there are other core/ owners which find ...
7 years, 1 month ago (2013-11-21 13:05:41 UTC) #1
abarth-chromium
@tyoshino: Would you like to review this CL?
7 years, 1 month ago (2013-11-21 21:59:16 UTC) #2
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/79953004/diff/1/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/1/Source/core/xml/XMLHttpRequest.cpp#newcode858 Source/core/xml/XMLHttpRequest.cpp:858: comment that we save these variables here since they're ...
7 years, 1 month ago (2013-11-22 04:48:21 UTC) #3
sof
Many thanks; handling of m_receivedLength is now hopefully tidier. https://codereview.chromium.org/79953004/diff/1/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/1/Source/core/xml/XMLHttpRequest.cpp#newcode858 Source/core/xml/XMLHttpRequest.cpp:858: ...
7 years, 1 month ago (2013-11-22 07:17:05 UTC) #4
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp#newcode965 Source/core/xml/XMLHttpRequest.cpp:965: void XMLHttpRequest::dispatchEventAndLoadEnd(const AtomicString& type, long long receivedLength, long long ...
7 years, 1 month ago (2013-11-22 07:39:22 UTC) #5
tyoshino (SeeGerritForStatus)
On 2013/11/22 07:39:22, tyoshino wrote: > https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp > File Source/core/xml/XMLHttpRequest.cpp (right): > > https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp#newcode965 > ...
7 years, 1 month ago (2013-11-22 07:43:14 UTC) #6
sof
On 2013/11/22 07:43:14, tyoshino wrote: > On 2013/11/22 07:39:22, tyoshino wrote: > > > https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp ...
7 years, 1 month ago (2013-11-22 07:49:13 UTC) #7
tyoshino (SeeGerritForStatus)
On 2013/11/22 07:49:13, sof wrote: > On 2013/11/22 07:43:14, tyoshino wrote: > > On 2013/11/22 ...
7 years, 1 month ago (2013-11-22 09:26:54 UTC) #8
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp#newcode1042 Source/core/xml/XMLHttpRequest.cpp:1042: dispatchThrottledProgressEvent(EventTypeNames::progress); this method should also take saved receivedLength and ...
7 years, 1 month ago (2013-11-22 09:48:32 UTC) #9
sof
https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/80001/Source/core/xml/XMLHttpRequest.cpp#newcode1042 Source/core/xml/XMLHttpRequest.cpp:1042: dispatchThrottledProgressEvent(EventTypeNames::progress); On 2013/11/22 09:48:32, tyoshino wrote: > this method ...
7 years, 1 month ago (2013-11-22 11:22:42 UTC) #10
tyoshino (SeeGerritForStatus)
i think it's almost done. https://codereview.chromium.org/79953004/diff/170001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/170001/Source/core/xml/XMLHttpRequest.cpp#newcode6 Source/core/xml/XMLHttpRequest.cpp:6: * Copyright (C) 2012 ...
7 years ago (2013-11-25 05:06:31 UTC) #11
sof
https://codereview.chromium.org/79953004/diff/170001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/170001/Source/core/xml/XMLHttpRequest.cpp#newcode974 Source/core/xml/XMLHttpRequest.cpp:974: void XMLHttpRequest::dispatchThrottledProgressEvent(const AtomicString& type, long long receivedLength, long long ...
7 years ago (2013-11-25 06:48:12 UTC) #12
tyoshino (SeeGerritForStatus)
On 2013/11/25 06:48:12, sof wrote: > https://codereview.chromium.org/79953004/diff/170001/Source/core/xml/XMLHttpRequest.cpp > File Source/core/xml/XMLHttpRequest.cpp (right): > > https://codereview.chromium.org/79953004/diff/170001/Source/core/xml/XMLHttpRequest.cpp#newcode974 > ...
7 years ago (2013-11-25 07:36:18 UTC) #13
sof
Now hopefully addressed. Thanks again :) https://codereview.chromium.org/79953004/diff/170001/Source/core/xml/XMLHttpRequest.h File Source/core/xml/XMLHttpRequest.h (right): https://codereview.chromium.org/79953004/diff/170001/Source/core/xml/XMLHttpRequest.h#newcode188 Source/core/xml/XMLHttpRequest.h:188: // m_progressEventThrottle. On ...
7 years ago (2013-11-25 07:40:03 UTC) #14
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/79953004/diff/250001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/250001/Source/core/xml/XMLHttpRequest.cpp#newcode979 Source/core/xml/XMLHttpRequest.cpp:979: expectedLength = m_response.expectedContentLength(); so now we can remove this
7 years ago (2013-11-25 07:46:53 UTC) #15
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/79953004/diff/250001/Source/core/xml/XMLHttpRequestUpload.cpp File Source/core/xml/XMLHttpRequestUpload.cpp (right): https://codereview.chromium.org/79953004/diff/250001/Source/core/xml/XMLHttpRequestUpload.cpp#newcode82 Source/core/xml/XMLHttpRequestUpload.cpp:82: dispatchEvent(XMLHttpRequestProgressEvent::create(EventTypeNames::progress, true, m_lastBytesSent, m_lastTotalBytesToBeSent)); looks we should have some ...
7 years ago (2013-11-25 08:06:14 UTC) #16
sof
Sorry, too sloppy this morning. https://codereview.chromium.org/79953004/diff/250001/Source/core/xml/XMLHttpRequest.cpp File Source/core/xml/XMLHttpRequest.cpp (right): https://codereview.chromium.org/79953004/diff/250001/Source/core/xml/XMLHttpRequest.cpp#newcode979 Source/core/xml/XMLHttpRequest.cpp:979: expectedLength = m_response.expectedContentLength(); On ...
7 years ago (2013-11-25 08:10:37 UTC) #17
sof
https://codereview.chromium.org/79953004/diff/250001/Source/core/xml/XMLHttpRequestUpload.cpp File Source/core/xml/XMLHttpRequestUpload.cpp (right): https://codereview.chromium.org/79953004/diff/250001/Source/core/xml/XMLHttpRequestUpload.cpp#newcode82 Source/core/xml/XMLHttpRequestUpload.cpp:82: dispatchEvent(XMLHttpRequestProgressEvent::create(EventTypeNames::progress, true, m_lastBytesSent, m_lastTotalBytesToBeSent)); On 2013/11/25 08:06:15, tyoshino wrote: ...
7 years ago (2013-11-25 11:38:24 UTC) #18
tyoshino (SeeGerritForStatus)
sorry for delay. finally reviewed whole CL. LG once the comments are addressed. https://codereview.chromium.org/79953004/diff/340001/LayoutTests/http/tests/xmlhttprequest/onload-event.html File ...
7 years ago (2013-11-25 12:35:32 UTC) #19
sof
https://codereview.chromium.org/79953004/diff/340001/Source/core/xml/XMLHttpRequestUpload.cpp File Source/core/xml/XMLHttpRequestUpload.cpp (right): https://codereview.chromium.org/79953004/diff/340001/Source/core/xml/XMLHttpRequestUpload.cpp#newcode72 Source/core/xml/XMLHttpRequestUpload.cpp:72: bool lengthComputable = m_lastTotalBytesToBeSent > 0 && m_lastBytesSent <= ...
7 years ago (2013-11-25 13:30:38 UTC) #20
tyoshino (SeeGerritForStatus)
https://codereview.chromium.org/79953004/diff/340001/Source/core/xml/XMLHttpRequestUpload.cpp File Source/core/xml/XMLHttpRequestUpload.cpp (right): https://codereview.chromium.org/79953004/diff/340001/Source/core/xml/XMLHttpRequestUpload.cpp#newcode72 Source/core/xml/XMLHttpRequestUpload.cpp:72: bool lengthComputable = m_lastTotalBytesToBeSent > 0 && m_lastBytesSent <= ...
7 years ago (2013-11-25 13:39:14 UTC) #21
sof
https://codereview.chromium.org/79953004/diff/340001/LayoutTests/http/tests/xmlhttprequest/onload-event.html File LayoutTests/http/tests/xmlhttprequest/onload-event.html (right): https://codereview.chromium.org/79953004/diff/340001/LayoutTests/http/tests/xmlhttprequest/onload-event.html#newcode21 LayoutTests/http/tests/xmlhttprequest/onload-event.html:21: assert_equals(e.loaded, expected, "Expected 'loaded' value for '" + context ...
7 years ago (2013-11-25 15:28:17 UTC) #22
tyoshino (SeeGerritForStatus)
lgtm Thank you! abarth: OWNER review please
7 years ago (2013-11-25 16:04:43 UTC) #23
abarth-chromium
rslgtm
7 years ago (2013-11-25 18:10:50 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/79953004/440001
7 years ago (2013-11-25 20:21:41 UTC) #25
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=18648
7 years ago (2013-11-25 23:11:16 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/79953004/440001
7 years ago (2013-11-26 07:11:40 UTC) #27
commit-bot: I haz the power
Retried try job too often on win_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_blink_rel&number=18719
7 years ago (2013-11-26 09:11:50 UTC) #28
sof
fast/xmlhttprequest/xmlhttprequest-get turned out unstable due to line termination differences across platforms; updated the test to ...
7 years ago (2013-11-26 09:50:34 UTC) #29
tyoshino (SeeGerritForStatus)
On 2013/11/26 09:50:34, sof wrote: > fast/xmlhttprequest/xmlhttprequest-get turned out unstable due to line > termination ...
7 years ago (2013-11-26 11:01:10 UTC) #30
sof
On 2013/11/26 11:01:10, tyoshino wrote: > On 2013/11/26 09:50:34, sof wrote: > > fast/xmlhttprequest/xmlhttprequest-get turned ...
7 years ago (2013-11-26 12:04:37 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sigbjornf@opera.com/79953004/460001
7 years ago (2013-11-26 12:05:18 UTC) #32
commit-bot: I haz the power
7 years ago (2013-11-26 13:09:47 UTC) #33
Message was sent while issue was closed.
Change committed as 162689

Powered by Google App Engine
This is Rietveld 408576698