Summary: | Cache API should return Abort error in case of putting an aborted fetch | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | youenn fablet <youennf> | ||||||
Component: | Service Workers | Assignee: | youenn fablet <youennf> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | achristensen, beidson, cdumez, commit-queue, darin, ryanhaddad, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
youenn fablet
2019-04-09 18:26:34 PDT
Created attachment 367093 [details]
Patch
Looks like EWS is all green. Who should review this? Comment on attachment 367093 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367093&action=review > Source/WebCore/ChangeLog:8 > + In case of an aborted fetch, return consume callback with an AbortError. I don’t understand what "return consume callback" means. I think you mean "invoke consume callback" or "call consume callback". > Source/WebCore/Modules/fetch/FetchResponse.cpp:217 > + if (auto bodyLoader = WTFMove(m_bodyLoader)) I am not sure that just doing std::move is a resilient design in cases like this. Using std::exchange gives a stronger guarantee that m_bodyLoader will actually become null and likely generates identical code. I have used std::move for this in the past but I am less sure now than I was then. Comment on attachment 367093 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=367093&action=review >> Source/WebCore/ChangeLog:8 >> + In case of an aborted fetch, return consume callback with an AbortError. > > I don’t understand what "return consume callback" means. I think you mean "invoke consume callback" or "call consume callback". Right, call consume callback is more appropriate. >> Source/WebCore/Modules/fetch/FetchResponse.cpp:217 >> + if (auto bodyLoader = WTFMove(m_bodyLoader)) > > I am not sure that just doing std::move is a resilient design in cases like this. Using std::exchange gives a stronger guarantee that m_bodyLoader will actually become null and likely generates identical code. I have used std::move for this in the past but I am less sure now than I was then. True. That said, we forked std::optional specifically to use this pattern. Created attachment 367965 [details]
Patch for landing
Comment on attachment 367965 [details] Patch for landing Clearing flags on attachment: 367965 Committed r244515: <https://trac.webkit.org/changeset/244515> All reviewed patches have been landed. Closing bug. |