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

Issue 2730943002: XMLHttpRequest: return null upon failing responseArrayBuffer allocation. (Closed)

Created:
3 years, 9 months ago by sof
Modified:
3 years, 9 months ago
CC:
chromium-reviews, tyoshino+watch_chromium.org, viettrungluu+watch_chromium.org, qsr+mojo_chromium.org, Aaron Boodman, eae+blinkwatch, yzshen+watch_chromium.org, abarth-chromium, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews, darin (slow to review), Mikhail, blink-reviews-wtf_chromium.org, rwlbuis
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

XMLHttpRequest: return null upon failing responseArrayBuffer allocation. The allocation of a response ArrayBuffer may fail, a large enough contiguous chunk of memory simply not being available from the underlying allocator. The spec [1] now admits allocation failure as a possibility, allowing the return of a null buffer if so. Update our implementation accordingly, returning null rather than failing hard with an OOM. 1 - https://xhr.spec.whatwg.org/#arraybuffer-response R=haraken,yhirano BUG=673211 Review-Url: https://codereview.chromium.org/2730943002 Cr-Commit-Position: refs/heads/master@{#455398} Committed: https://chromium.googlesource.com/chromium/src/+/7c838d986a3d95e81971ef40050fecce0ea2be2c

Patch Set 1 #

Total comments: 2

Patch Set 2 : update comment #

Total comments: 2

Patch Set 3 : mirror updated spec, and return |null| for failed allocs #

Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -22 lines) Patch
M third_party/WebKit/Source/core/dom/DOMArrayBuffer.h View 1 chunk +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/dom/DOMArrayBuffer.cpp View 1 chunk +11 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/mojo/MojoHandle.cpp View 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 1 chunk +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp View 1 2 3 chunks +17 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/wtf/typed_arrays/ArrayBuffer.h View 1 2 chunks +5 lines, -6 lines 0 comments Download

Messages

Total messages: 29 (19 generated)
sof
please take a look. (haraken@ for wtf/ ) the condition to test is straightforward, but ...
3 years, 9 months ago (2017-03-03 16:13:07 UTC) #4
haraken
LGTM on my side with a comment. https://codereview.chromium.org/2730943002/diff/1/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp (right): https://codereview.chromium.org/2730943002/diff/1/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp#newcode399 third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp:399: // fails. ...
3 years, 9 months ago (2017-03-03 19:23:27 UTC) #7
sof
https://codereview.chromium.org/2730943002/diff/1/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp (right): https://codereview.chromium.org/2730943002/diff/1/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp#newcode399 third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp:399: // fails. On 2017/03/03 19:23:26, haraken wrote: > > ...
3 years, 9 months ago (2017-03-03 21:23:53 UTC) #8
yhirano
https://codereview.chromium.org/2730943002/diff/20001/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp (right): https://codereview.chromium.org/2730943002/diff/20001/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp#newcode403 third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp:403: m_responseArrayBuffer = DOMArrayBuffer::create(nullptr, 0); This getter returns null for ...
3 years, 9 months ago (2017-03-06 09:19:53 UTC) #12
sof
https://codereview.chromium.org/2730943002/diff/20001/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp (right): https://codereview.chromium.org/2730943002/diff/20001/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp#newcode403 third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp:403: m_responseArrayBuffer = DOMArrayBuffer::create(nullptr, 0); On 2017/03/06 09:19:53, yhirano (slow) ...
3 years, 9 months ago (2017-03-06 09:29:16 UTC) #13
sof
On 2017/03/06 09:29:16, sof wrote: > https://codereview.chromium.org/2730943002/diff/20001/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp > File third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp (right): > > https://codereview.chromium.org/2730943002/diff/20001/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp#newcode403 > ...
3 years, 9 months ago (2017-03-06 16:12:50 UTC) #16
sof
On 2017/03/06 16:12:50, sof wrote: > On 2017/03/06 09:29:16, sof wrote: > > > https://codereview.chromium.org/2730943002/diff/20001/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp ...
3 years, 9 months ago (2017-03-07 16:40:43 UTC) #21
yhirano
lgtm
3 years, 9 months ago (2017-03-08 08:00:04 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2730943002/40001
3 years, 9 months ago (2017-03-08 08:16:27 UTC) #26
commit-bot: I haz the power
3 years, 9 months ago (2017-03-08 08:21:32 UTC) #29
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/7c838d986a3d95e81971ef40050f...

Powered by Google App Engine
This is Rietveld 408576698