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

Issue 294593002: ServiceWorker: Support longest-prefix-match for registration scope (Closed)

Created:
6 years, 7 months ago by nhiroki
Modified:
6 years, 6 months ago
CC:
chromium-reviews, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+watch, alecflett+watch_chromium.org
Visibility:
Public.

Description

ServiceWorker: Support longest-prefix-match for registration scope Current implementation matches a registration in the first-match way, but the spec[1] requires to match one in the longest-prefix-match way. This CL introduces LongestScopeMatcher which compares candidate scopes in the longest-prefix-match way. [1] http://www.w3.org/TR/2014/WD-service-workers-20140508/ BUG=370773 TEST=content_unittests --gtest_filter=ServiceWorkerStorageTest.* TEST=content_unittests --gtest_filter=ServiceWorkerUtilsTest.* Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=275153

Patch Set 1 : #

Total comments: 17

Patch Set 2 : remake (drop the exact-match) #

Total comments: 8

Patch Set 3 : rebase #

Patch Set 4 : add LongestScopeMatcher #

Patch Set 5 : cleanup #

Total comments: 4

Patch Set 6 : rebase #

Patch Set 7 : address comments #

Patch Set 8 : fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -17 lines) Patch
M content/browser/service_worker/service_worker_storage.cc View 1 2 3 4 5 2 chunks +19 lines, -17 lines 0 comments Download
M content/browser/service_worker/service_worker_storage_unittest.cc View 1 2 2 chunks +109 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_utils.h View 1 2 3 4 5 6 2 chunks +17 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_utils.cc View 1 2 3 4 5 6 7 2 chunks +32 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_utils_unittest.cc View 1 2 3 4 5 6 7 1 chunk +31 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
nhiroki
Hi, can you review this? This change obviously conflicts with your changes[1,2]. I'll rebase this ...
6 years, 7 months ago (2014-05-21 16:25:59 UTC) #1
jsbell
https://codereview.chromium.org/294593002/diff/120001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/294593002/diff/120001/content/browser/service_worker/service_worker_register_job.cc#newcode411 content/browser/service_worker/service_worker_register_job.cc:411: if (result == ServiceWorkerUtils::SCOPE_EXACT_MATCH || The spec doesn't call ...
6 years, 7 months ago (2014-05-21 19:20:02 UTC) #2
nhiroki
Thanks for your comments! https://codereview.chromium.org/294593002/diff/120001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/294593002/diff/120001/content/browser/service_worker/service_worker_register_job.cc#newcode411 content/browser/service_worker/service_worker_register_job.cc:411: if (result == ServiceWorkerUtils::SCOPE_EXACT_MATCH || ...
6 years, 7 months ago (2014-05-22 00:02:18 UTC) #3
michaeln
https://codereview.chromium.org/294593002/diff/120001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/294593002/diff/120001/content/browser/service_worker/service_worker_register_job.cc#newcode401 content/browser/service_worker/service_worker_register_job.cc:401: ServiceWorkerVersion* version) { when the input is NULL, this ...
6 years, 7 months ago (2014-05-22 00:56:29 UTC) #4
dominicc (has gone to gerrit)
I have some questions inline. I'm not super familiar with this code so some of ...
6 years, 7 months ago (2014-05-22 05:03:30 UTC) #5
michaeln
https://codereview.chromium.org/294593002/diff/120001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/294593002/diff/120001/content/browser/service_worker/service_worker_register_job.cc#newcode413 content/browser/service_worker/service_worker_register_job.cc:413: host->SetPendingVersion(version); > FWIW there are some related comments on ...
6 years, 7 months ago (2014-05-23 01:23:27 UTC) #6
dominicc (has gone to gerrit)
On 2014/05/23 01:23:27, michaeln wrote: > > I know we don't mix versions from different ...
6 years, 7 months ago (2014-05-26 02:59:20 UTC) #7
nhiroki
Hmm... this CL seems to try to clear some issues: - Support the longest-prefix-match - ...
6 years, 7 months ago (2014-05-27 16:00:00 UTC) #8
nhiroki
On 2014/05/27 16:00:00, nhiroki wrote: > - Clear a pending version associated with documents on ...
6 years, 7 months ago (2014-05-27 16:04:07 UTC) #9
michaeln1
> > I think its the intent of the spec to not mix-n-match. > > ...
6 years, 7 months ago (2014-05-27 21:10:10 UTC) #10
dominicc (has gone to gerrit)
We're kind of abusing this code review for discussion, but the context is here so ...
6 years, 7 months ago (2014-05-27 23:25:40 UTC) #11
jsbell
https://codereview.chromium.org/294593002/diff/160001/content/browser/service_worker/service_worker_storage.cc File content/browser/service_worker/service_worker_storage.cc (right): https://codereview.chromium.org/294593002/diff/160001/content/browser/service_worker/service_worker_storage.cc#newcode675 content/browser/service_worker/service_worker_storage.cc:675: std::vector<GURL> scopes; Ugh. This approach is not going to ...
6 years, 6 months ago (2014-06-02 18:33:40 UTC) #12
jsbell
https://codereview.chromium.org/294593002/diff/160001/content/browser/service_worker/service_worker_utils.cc File content/browser/service_worker/service_worker_utils.cc (right): https://codereview.chromium.org/294593002/diff/160001/content/browser/service_worker/service_worker_utils.cc#newcode42 content/browser/service_worker/service_worker_utils.cc:42: if (!found || scopes.at(*pos) < scopes.at(i)) { On 2014/06/02 ...
6 years, 6 months ago (2014-06-02 18:36:53 UTC) #13
jsbell
https://codereview.chromium.org/294593002/diff/160001/content/browser/service_worker/service_worker_utils.cc File content/browser/service_worker/service_worker_utils.cc (right): https://codereview.chromium.org/294593002/diff/160001/content/browser/service_worker/service_worker_utils.cc#newcode42 content/browser/service_worker/service_worker_utils.cc:42: if (!found || scopes.at(*pos) < scopes.at(i)) { Ah, I ...
6 years, 6 months ago (2014-06-02 19:31:22 UTC) #14
michaeln
hiroki has a real similar cl (identical) up for review seperately. https://codereview.chromium.org/304423004/ Since this one ...
6 years, 6 months ago (2014-06-02 20:18:07 UTC) #15
nhiroki
Thank you for reviewing. To optimize matching, I introduced LongestScopeMatcher. Can you take another look? ...
6 years, 6 months ago (2014-06-03 18:05:01 UTC) #16
jsbell
lgtm! Re: "/fo*" vs. "/foo" - I agree it should be defined in the spec. ...
6 years, 6 months ago (2014-06-03 18:48:29 UTC) #17
michaeln
lgtm2
6 years, 6 months ago (2014-06-03 19:16:52 UTC) #18
nhiroki
On 2014/06/03 18:48:29, jsbell wrote: > Re: "/fo*" vs. "/foo" - I agree it should ...
6 years, 6 months ago (2014-06-05 11:00:34 UTC) #19
nhiroki
The CQ bit was checked by nhiroki@chromium.org
6 years, 6 months ago (2014-06-05 11:21:43 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nhiroki@chromium.org/294593002/310001
6 years, 6 months ago (2014-06-05 11:22:45 UTC) #21
commit-bot: I haz the power
6 years, 6 months ago (2014-06-05 16:33:53 UTC) #22
Message was sent while issue was closed.
Change committed as 275153

Powered by Google App Engine
This is Rietveld 408576698