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

Issue 708703002: Service Worker: Cache.put() consumes request/response bodies (Closed)

Created:
6 years, 1 month ago by jsbell
Modified:
6 years, 1 month ago
Reviewers:
asanka, gavinp, bkelly
CC:
blink-reviews, michaeln, jsbell+serviceworker_chromium.org, kenjibaheux+watch_chromium.org, tzik, serviceworker-reviews, nhiroki, falken, kinuko+serviceworker, horo+watch_chromium.org
Project:
blink
Visibility:
Public.

Description

Service Worker: Cache.put() consumes request/response bodies Per SW spec issue: https://github.com/slightlyoff/ServiceWorker/issues/550 Cache.put() should throw if request/response bodies are already used, and consume request body (if non-empty) and response body. BUG=430962 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=185323

Patch Set 1 #

Patch Set 2 : Add test, reject if body already used #

Patch Set 3 : Use Response bodies too, but only Request bodies if non-empty #

Total comments: 2

Patch Set 4 : Rebased #

Patch Set 5 : Cleaned up Cache::put code #

Total comments: 3

Patch Set 6 : Inline hasBody methods #

Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -41 lines) Patch
M LayoutTests/http/tests/serviceworker/cache-match-expected.txt View 1 2 3 1 chunk +15 lines, -15 lines 0 comments Download
M LayoutTests/http/tests/serviceworker/cache-put-expected.txt View 1 2 3 2 chunks +5 lines, -1 line 0 comments Download
M LayoutTests/http/tests/serviceworker/resources/cache-match-worker.js View 1 2 3 2 chunks +3 lines, -2 lines 0 comments Download
M LayoutTests/http/tests/serviceworker/resources/cache-put-worker.js View 1 2 3 8 chunks +74 lines, -16 lines 0 comments Download
M Source/modules/serviceworkers/Body.h View 2 chunks +3 lines, -4 lines 0 comments Download
M Source/modules/serviceworkers/Cache.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/serviceworkers/Cache.cpp View 1 2 3 4 1 chunk +10 lines, -1 line 0 comments Download
M Source/modules/serviceworkers/CacheTest.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/serviceworkers/Request.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/modules/serviceworkers/Response.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (3 generated)
jsbell
This is my interpretation of https://github.com/slightlyoff/ServiceWorker/issues/550 - I'm pretty sure it doesn't the subtleties in ...
6 years, 1 month ago (2014-11-07 20:11:55 UTC) #2
jsbell
Adding bkelly@ to reviewers, specifically for the test changes.
6 years, 1 month ago (2014-11-07 20:25:24 UTC) #4
bkelly
https://codereview.chromium.org/708703002/diff/40001/Source/modules/serviceworkers/Cache.cpp File Source/modules/serviceworkers/Cache.cpp (right): https://codereview.chromium.org/708703002/diff/40001/Source/modules/serviceworkers/Cache.cpp#newcode236 Source/modules/serviceworkers/Cache.cpp:236: response->setBodyUsed(); While it will be a somewhat rare case, ...
6 years, 1 month ago (2014-11-07 20:35:19 UTC) #5
bkelly
The tests look good to me, although I have not run them. Our Request/Response clone() ...
6 years, 1 month ago (2014-11-07 20:41:22 UTC) #6
jsbell
On 2014/11/07 20:35:19, bkelly wrote: > https://codereview.chromium.org/708703002/diff/40001/Source/modules/serviceworkers/Cache.cpp > File Source/modules/serviceworkers/Cache.cpp (right): > > https://codereview.chromium.org/708703002/diff/40001/Source/modules/serviceworkers/Cache.cpp#newcode236 > ...
6 years, 1 month ago (2014-11-07 21:15:08 UTC) #7
jsbell
Rebased, which left Cache::put() pretty messy. I'll see if I can clean that up a ...
6 years, 1 month ago (2014-11-11 17:59:54 UTC) #8
jsbell
Okay, bots look happy. gavinp@, asanka@ - PTAL? This latest iteration should be able to ...
6 years, 1 month ago (2014-11-12 01:13:50 UTC) #9
asanka
LGTM!
6 years, 1 month ago (2014-11-12 15:42:03 UTC) #10
gavinp
LGTM. My comments are nits, this can land with or without them addressed. https://codereview.chromium.org/708703002/diff/80001/Source/modules/serviceworkers/Body.h File ...
6 years, 1 month ago (2014-11-13 19:35:03 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/708703002/100001
6 years, 1 month ago (2014-11-13 20:53:06 UTC) #13
jsbell
Thanks! https://codereview.chromium.org/708703002/diff/80001/Source/modules/serviceworkers/Body.h File Source/modules/serviceworkers/Body.h (right): https://codereview.chromium.org/708703002/diff/80001/Source/modules/serviceworkers/Body.h#newcode48 Source/modules/serviceworkers/Body.h:48: void setBodyUsed(); On 2014/11/13 19:35:02, gavinp wrote: > ...
6 years, 1 month ago (2014-11-13 21:16:05 UTC) #14
commit-bot: I haz the power
6 years, 1 month ago (2014-11-13 21:58:10 UTC) #15
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as 185323

Powered by Google App Engine
This is Rietveld 408576698