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

Issue 2204683002: Cache API should not match() HEAD requests (Closed)

Created:
4 years, 4 months ago by jsbell
Modified:
4 years, 4 months ago
Reviewers:
jkarlin, cmumford
CC:
chromium-reviews, blink-reviews, haraken
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Cache API should not match() HEAD requests Per spec issue, the match()/matchAll() methods should not match HEAD requests, yielding undefined (or an empty result set). [1] https://github.com/slightlyoff/ServiceWorker/issues/710#issuecomment-236641802 BUG=633358 Committed: https://crrev.com/b482718f3ced3088afbd8bfdd7ff51fdfdc9bc8e Cr-Commit-Position: refs/heads/master@{#411172}

Patch Set 1 #

Patch Set 2 : caches.match() test and fix #

Patch Set 3 : Add unit tests #

Total comments: 3

Patch Set 4 : Align with spec #

Patch Set 5 : Add keys()/delete() tests, fix found issues #

Total comments: 15

Patch Set 6 : Review feedback #

Total comments: 2

Patch Set 7 : HEAD -> Head #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -69 lines) Patch
M content/browser/cache_storage/cache_storage_cache.cc View 1 2 3 4 5 2 chunks +14 lines, -0 lines 0 comments Download
M content/browser/cache_storage/cache_storage_cache_unittest.cc View 1 2 3 4 5 6 5 chunks +32 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-delete.js View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js View 1 2 3 4 5 2 chunks +19 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-match.js View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-matchAll.js View 1 2 1 chunk +10 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-storage-match.js View 1 3 chunks +16 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/serviceworker/cache-match-expected.txt View 1 2 3 1 chunk +0 lines, -20 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/serviceworker/cache-matchAll-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/cachestorage/window/cache-keys.html View 1 2 3 4 1 chunk +3 lines, -3 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/window/cache-match-expected.txt View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/window/cache-matchAll-expected.txt View 1 2 1 chunk +2 lines, -1 line 0 comments Download
A + third_party/WebKit/LayoutTests/http/tests/cachestorage/worker/cache-keys.html View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/worker/cache-match-expected.txt View 1 2 3 1 chunk +0 lines, -19 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/cachestorage/worker/cache-matchAll-expected.txt View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/cachestorage/Cache.cpp View 1 2 3 4 5 4 chunks +16 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/cachestorage/CacheStorage.cpp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 43 (23 generated)
jsbell
jkarlin@, cmumford@ - please take a look? It may be cleaner to do this on ...
4 years, 4 months ago (2016-08-01 22:46:01 UTC) #4
cmumford
lgtm
4 years, 4 months ago (2016-08-02 13:12:59 UTC) #7
jkarlin
What about CacheStorage::Match requests?
4 years, 4 months ago (2016-08-02 13:37:34 UTC) #8
jsbell
On 2016/08/02 13:37:34, jkarlin wrote: > What about CacheStorage::Match requests? Oh duh, of course. Thoughts ...
4 years, 4 months ago (2016-08-02 16:52:06 UTC) #9
jkarlin
On 2016/08/02 16:52:06, jsbell wrote: > On 2016/08/02 13:37:34, jkarlin wrote: > > What about ...
4 years, 4 months ago (2016-08-02 17:55:00 UTC) #10
jsbell
jkarlin@ - please take a look? I went with CacheStorageCache::MatchImpl() rather than Match() to keep ...
4 years, 4 months ago (2016-08-03 17:34:01 UTC) #15
jkarlin
https://codereview.chromium.org/2204683002/diff/40001/content/browser/cache_storage/cache_storage_cache.cc File content/browser/cache_storage/cache_storage_cache.cc (right): https://codereview.chromium.org/2204683002/diff/40001/content/browser/cache_storage/cache_storage_cache.cc#newcode800 content/browser/cache_storage/cache_storage_cache.cc:800: if (request && request->method == "HEAD") { The updated ...
4 years, 4 months ago (2016-08-04 14:50:40 UTC) #16
jkarlin
https://codereview.chromium.org/2204683002/diff/40001/content/browser/cache_storage/cache_storage_cache.cc File content/browser/cache_storage/cache_storage_cache.cc (right): https://codereview.chromium.org/2204683002/diff/40001/content/browser/cache_storage/cache_storage_cache.cc#newcode800 content/browser/cache_storage/cache_storage_cache.cc:800: if (request && request->method == "HEAD") { On 2016/08/04 ...
4 years, 4 months ago (2016-08-04 14:52:18 UTC) #17
jsbell
This should match the spec updates, but I need to add tests for the keys() ...
4 years, 4 months ago (2016-08-04 23:49:17 UTC) #20
jsbell
Okay, I think this is ready for a look-see. Added cache-keys tests (did we really ...
4 years, 4 months ago (2016-08-09 23:39:02 UTC) #23
jkarlin
Looking good! https://codereview.chromium.org/2204683002/diff/80001/content/browser/cache_storage/cache_storage_cache.cc File content/browser/cache_storage/cache_storage_cache.cc (right): https://codereview.chromium.org/2204683002/diff/80001/content/browser/cache_storage/cache_storage_cache.cc#newcode598 content/browser/cache_storage/cache_storage_cache.cc:598: callback.Run(CACHE_STORAGE_OK, base::WrapUnique(new QueryCacheResults( base::MakeUnique<QueryCacheResults>(std::move(request), options, callback) is ...
4 years, 4 months ago (2016-08-10 13:22:45 UTC) #24
jsbell
https://codereview.chromium.org/2204683002/diff/80001/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js File third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js (right): https://codereview.chromium.org/2204683002/diff/80001/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js#newcode1 third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js:1: if (self.importScripts) { On 2016/08/10 13:22:45, jkarlin wrote: > ...
4 years, 4 months ago (2016-08-10 15:50:10 UTC) #25
jsbell
Yet another look, jkarlin@ ? Thanks for your patience! https://codereview.chromium.org/2204683002/diff/80001/content/browser/cache_storage/cache_storage_cache.cc File content/browser/cache_storage/cache_storage_cache.cc (right): https://codereview.chromium.org/2204683002/diff/80001/content/browser/cache_storage/cache_storage_cache.cc#newcode598 content/browser/cache_storage/cache_storage_cache.cc:598: ...
4 years, 4 months ago (2016-08-10 17:18:09 UTC) #28
jkarlin
lgtm! https://codereview.chromium.org/2204683002/diff/80001/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js File third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js (right): https://codereview.chromium.org/2204683002/diff/80001/third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js#newcode39 third_party/WebKit/LayoutTests/http/tests/cachestorage/script-tests/cache-keys.js:39: assert_equals(requests.length, 1); On 2016/08/10 15:50:10, jsbell wrote: > ...
4 years, 4 months ago (2016-08-10 17:30:04 UTC) #29
jsbell
https://codereview.chromium.org/2204683002/diff/100001/content/browser/cache_storage/cache_storage_cache_unittest.cc File content/browser/cache_storage/cache_storage_cache_unittest.cc (right): https://codereview.chromium.org/2204683002/diff/100001/content/browser/cache_storage/cache_storage_cache_unittest.cc#newcode960 content/browser/cache_storage/cache_storage_cache_unittest.cc:960: TEST_P(CacheStorageCacheTestP, MatchAll_HEAD) { On 2016/08/10 17:30:04, jkarlin wrote: > ...
4 years, 4 months ago (2016-08-10 20:10:49 UTC) #32
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/2204683002/120001
4 years, 4 months ago (2016-08-10 20:11:40 UTC) #36
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/120156)
4 years, 4 months ago (2016-08-10 21:01:04 UTC) #38
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/2204683002/120001
4 years, 4 months ago (2016-08-10 21:19:28 UTC) #40
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 4 months ago (2016-08-10 22:47:53 UTC) #41
commit-bot: I haz the power
4 years, 4 months ago (2016-08-10 22:50:14 UTC) #43
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/b482718f3ced3088afbd8bfdd7ff51fdfdc9bc8e
Cr-Commit-Position: refs/heads/master@{#411172}

Powered by Google App Engine
This is Rietveld 408576698