RESOLVED FIXED 175658
[Cache API] Add response body storage
https://bugs.webkit.org/show_bug.cgi?id=175658
Summary [Cache API] Add response body storage
youenn fablet
Reported 2017-08-16 23:19:01 PDT
[Cache API] Add response body storage
Attachments
Patch (22.48 KB, patch)
2017-08-16 23:24 PDT, youenn fablet
no flags
Patch (22.25 KB, patch)
2017-08-17 09:50 PDT, youenn fablet
no flags
Patch (22.22 KB, patch)
2017-08-17 10:27 PDT, youenn fablet
no flags
Patch (22.21 KB, patch)
2017-08-17 11:15 PDT, youenn fablet
no flags
Patch (22.00 KB, patch)
2017-08-17 11:22 PDT, youenn fablet
no flags
Patch (351.42 KB, patch)
2017-08-18 09:52 PDT, youenn fablet
no flags
Patch for landing (351.49 KB, patch)
2017-08-18 11:08 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2017-08-16 23:24:01 PDT
youenn fablet
Comment 2 2017-08-17 09:50:42 PDT
youenn fablet
Comment 3 2017-08-17 10:27:17 PDT
youenn fablet
Comment 4 2017-08-17 11:15:02 PDT
youenn fablet
Comment 5 2017-08-17 11:22:23 PDT
Alex Christensen
Comment 6 2017-08-17 15:40:16 PDT
Comment on attachment 318390 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318390&action=review > Source/WebCore/Modules/fetch/FetchResponse.h:109 > + static void startFetching(ScriptExecutionContext&, FetchRequest&, std::optional<FetchPromise>&&, std::optional<EndOfLoad>&&); I don't think it's elegant to change FetchResponse from a class that used to always resolve a promise when it's done to a class that either resolves a promise when it's done or calls a lambda. I think instead we should make it a class that always calls a lambda when it's done and the lambda would resolve a promise in the cases where it should, or we should take a Variant<FetchPromise, EndOfLoadCallback> to make it clear that it does one or the other, then make better abstractions for what it is supposed to do when it's done.
youenn fablet
Comment 7 2017-08-17 18:37:47 PDT
> I don't think it's elegant to change FetchResponse from a class that used to > always resolve a promise when it's done to a class that either resolves a > promise when it's done or calls a lambda. I think instead we should make it > a class that always calls a lambda when it's done and the lambda would > resolve a promise in the cases where it should, or we should take a > Variant<FetchPromise, EndOfLoadCallback> to make it clear that it does one > or the other, then make better abstractions for what it is supposed to do > when it's done. The two lambdas will be useful for the same fetch response in the future. I will change the promise into a lambda and add a setter for EndOfLoadCallback.
youenn fablet
Comment 8 2017-08-18 09:52:42 PDT
Alex Christensen
Comment 9 2017-08-18 10:48:30 PDT
Comment on attachment 318514 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318514&action=review > Source/WebKit/Shared/WebCoreArgumentCoders.cpp:114 > +static void encodeSharedBuffer(Encoder& encoder, const SharedBuffer* buffer) We're just moving this code to use it below? We already kind of have this in SharedBufferDataReference. This should be united with that, and maybe that should be cleaned up.
youenn fablet
Comment 10 2017-08-18 10:58:00 PDT
(In reply to Alex Christensen from comment #9) > Comment on attachment 318514 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=318514&action=review > > > Source/WebKit/Shared/WebCoreArgumentCoders.cpp:114 > > +static void encodeSharedBuffer(Encoder& encoder, const SharedBuffer* buffer) > > We're just moving this code to use it below? We already kind of have this > in SharedBufferDataReference. This should be united with that, and maybe > that should be cleaned up. Didn't know about SharedBufferDataReference. Code is moved and refreshed a bit. It also fixes a potential bug when trying to encode a SharedBuffer whose size is 0.
youenn fablet
Comment 11 2017-08-18 11:03:08 PDT
Comment on attachment 318514 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=318514&action=review > Source/WebKit/Shared/WebCoreArgumentCoders.cpp:367 > + responseBody = buffer.releaseNonNull(); But then, we should only set responseBody if buffer is not null here...
youenn fablet
Comment 12 2017-08-18 11:08:26 PDT
Created attachment 318519 [details] Patch for landing
Alex Christensen
Comment 13 2017-08-18 11:16:07 PDT
(In reply to youenn fablet from comment #10) > Didn't know about SharedBufferDataReference. We should probably get rid of it.
WebKit Commit Bot
Comment 14 2017-08-18 12:32:52 PDT
Comment on attachment 318519 [details] Patch for landing Clearing flags on attachment: 318519 Committed r220928: <http://trac.webkit.org/changeset/220928>
WebKit Commit Bot
Comment 15 2017-08-18 12:32:54 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 16 2017-08-18 12:33:40 PDT
Note You need to log in before you can comment on or make changes to this bug.