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

Issue 380093002: Update installed ServiceWorkers. (Closed)

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

Description

Update installed ServiceWorkers. The cl defines a new job type for UPDATE_JOB and modifies the ServiceWorkerRegisterJob class to be able to perform this type of job in addition to the REGISTRATION_JOB. There is much in common between the two. An update job is scheduled to run shortly after a page is loaded thru a service worker. The job checks for a new script resource and if found, goes thru the process of installing the new service worker and possibly activating it. Generally, activation has to be deferred until the page that was loaded closes. The update job sets up a deferred activation helper for that case prior to completing w/o having performed the activation. BUG=371671 TEST=unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284329

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 6

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Patch Set 10 : #

Patch Set 11 : #

Total comments: 4

Patch Set 12 : rebase #

Patch Set 13 : #

Patch Set 14 : #

Total comments: 13

Patch Set 15 : #

Patch Set 16 : #

Patch Set 17 : #

Total comments: 35

Patch Set 18 : tests #

Patch Set 19 : #

Patch Set 20 : #

Total comments: 8

Patch Set 21 : response to comments #

Patch Set 22 : rebase #

Patch Set 23 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1008 lines, -172 lines) Patch
M content/browser/service_worker/embedded_worker_test_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +9 lines, -2 lines 0 comments Download
M content/browser/service_worker/embedded_worker_test_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +45 lines, -6 lines 0 comments Download
M content/browser/service_worker/service_worker_context_core.h View 2 chunks +1 line, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_context_core.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_controllee_request_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +6 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_job_coordinator.h View 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_job_coordinator.cc View 1 2 3 4 5 6 7 8 9 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_job_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +284 lines, -4 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 6 chunks +37 lines, -29 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 14 chunks +134 lines, -80 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job_base.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +5 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_registration.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +18 lines, -15 lines 0 comments Download
M content/browser/service_worker/service_worker_registration.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +78 lines, -3 lines 0 comments Download
M content/browser/service_worker/service_worker_registration_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 3 chunks +94 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_script_cache_map.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_storage.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +5 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_storage.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +145 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_storage_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +110 lines, -16 lines 0 comments Download
M content/browser/service_worker/service_worker_unregister_job.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M content/browser/service_worker/service_worker_version.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 2 chunks +6 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -1 line 0 comments Download

Messages

Total messages: 31 (0 generated)
michaeln
not ready yet, but i think i'm close to having something work
6 years, 5 months ago (2014-07-10 03:01:48 UTC) #1
falken
Great to hear this is almost working! I roughly looked over it, it all looks ...
6 years, 5 months ago (2014-07-10 03:45:32 UTC) #2
nhiroki
Looks good overall. I'm looking forward to playing with '.update' feature :) https://codereview.chromium.org/380093002/diff/30001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc ...
6 years, 5 months ago (2014-07-10 09:14:14 UTC) #3
michaeln
https://codereview.chromium.org/380093002/diff/30001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/380093002/diff/30001/content/browser/service_worker/service_worker_register_job.cc#newcode253 content/browser/service_worker/service_worker_register_job.cc:253: ServiceWorkerStatusCode status) { On 2014/07/10 09:14:14, nhiroki wrote: > ...
6 years, 5 months ago (2014-07-14 23:02:30 UTC) #4
michaeln
hi, ptal i think this is ready for review now, i'll update cl description and ...
6 years, 5 months ago (2014-07-15 00:59:24 UTC) #5
nhiroki
lgtm https://codereview.chromium.org/380093002/diff/180001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/380093002/diff/180001/content/browser/service_worker/service_worker_register_job.cc#newcode118 content/browser/service_worker/service_worker_register_job.cc:118: pattern_, next_step); nit: Maybe you can squash this ...
6 years, 5 months ago (2014-07-15 03:57:05 UTC) #6
falken
On 2014/07/15 00:59:24, michaeln wrote: > hi, ptal i think this is ready for review ...
6 years, 5 months ago (2014-07-15 11:23:09 UTC) #7
michaeln
https://codereview.chromium.org/380093002/diff/180001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/380093002/diff/180001/content/browser/service_worker/service_worker_register_job.cc#newcode118 content/browser/service_worker/service_worker_register_job.cc:118: pattern_, next_step); On 2014/07/15 03:57:04, nhiroki wrote: > nit: ...
6 years, 5 months ago (2014-07-16 00:32:54 UTC) #8
michaeln
added a couple of unittest but nothing that really tests the update algo yet
6 years, 5 months ago (2014-07-16 01:41:04 UTC) #9
nhiroki
LGTM2
6 years, 5 months ago (2014-07-16 10:37:15 UTC) #10
nhiroki
https://codereview.chromium.org/380093002/diff/240001/content/browser/service_worker/service_worker_registration_unittest.cc File content/browser/service_worker/service_worker_registration_unittest.cc (right): https://codereview.chromium.org/380093002/diff/240001/content/browser/service_worker/service_worker_registration_unittest.cc#newcode48 content/browser/service_worker/service_worker_registration_unittest.cc:48: const ServiceWorkerRegistrationInfo& info) { Can you mark this with ...
6 years, 5 months ago (2014-07-16 10:39:20 UTC) #11
falken
Sorry, I didn't realize my gardening shift included today also so didn't have time to ...
6 years, 5 months ago (2014-07-16 17:00:28 UTC) #12
michaeln
https://codereview.chromium.org/380093002/diff/240001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/380093002/diff/240001/content/browser/service_worker/service_worker_register_job.cc#newcode39 content/browser/service_worker/service_worker_register_job.cc:39: scoped_ptr<DeferredActivationHelper> self_deletor(this); On 2014/07/16 17:00:28, falken wrote: > It ...
6 years, 5 months ago (2014-07-16 19:45:21 UTC) #13
michaeln
i'm working on some ServiceWorkerRegistrationJobTests (EmbeddedWorkerTestHelper is immensely useful), i want to get some basic ...
6 years, 5 months ago (2014-07-17 01:03:33 UTC) #14
falken
looks pretty good https://codereview.chromium.org/380093002/diff/240001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/380093002/diff/240001/content/browser/service_worker/service_worker_register_job.cc#newcode39 content/browser/service_worker/service_worker_register_job.cc:39: scoped_ptr<DeferredActivationHelper> self_deletor(this); On 2014/07/16 19:45:21, michaeln ...
6 years, 5 months ago (2014-07-17 06:33:43 UTC) #15
michaeln
I've added two basic tests without any complicating aspects. I like how the test harness ...
6 years, 5 months ago (2014-07-18 03:40:49 UTC) #16
falken
LGTM https://codereview.chromium.org/380093002/diff/300001/content/browser/service_worker/service_worker_register_job_base.h File content/browser/service_worker/service_worker_register_job_base.h (right): https://codereview.chromium.org/380093002/diff/300001/content/browser/service_worker/service_worker_register_job_base.h#newcode9 content/browser/service_worker/service_worker_register_job_base.h:9: On 2014/07/18 03:40:48, michaeln wrote: > On 2014/07/17 ...
6 years, 5 months ago (2014-07-18 05:13:25 UTC) #17
michaeln
https://codereview.chromium.org/380093002/diff/360001/content/browser/service_worker/service_worker_registration.h File content/browser/service_worker/service_worker_registration.h (right): https://codereview.chromium.org/380093002/diff/360001/content/browser/service_worker/service_worker_registration.h#newcode23 content/browser/service_worker/service_worker_registration.h:23: // This class represents a service worker regiratration. The ...
6 years, 5 months ago (2014-07-18 19:19:24 UTC) #18
michaeln
The CQ bit was checked by michaeln@chromium.org
6 years, 5 months ago (2014-07-18 19:29:11 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/michaeln@chromium.org/380093002/400001
6 years, 5 months ago (2014-07-18 19:32:37 UTC) #20
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_triggered_tests on tryserver.chromium ...
6 years, 5 months ago (2014-07-18 22:05:30 UTC) #21
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-18 22:10:23 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: android_dbg_triggered_tests on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/android_dbg_triggered_tests/builds/172702)
6 years, 5 months ago (2014-07-18 22:10:24 UTC) #23
michaeln
The CQ bit was checked by michaeln@chromium.org
6 years, 5 months ago (2014-07-18 22:40:48 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/michaeln@chromium.org/380093002/420001
6 years, 5 months ago (2014-07-18 22:42:09 UTC) #25
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: ios_rel_device on tryserver.chromium ...
6 years, 5 months ago (2014-07-19 02:04:09 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-19 02:08:12 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: ios_rel_device on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/ios_rel_device/builds/160893)
6 years, 5 months ago (2014-07-19 02:08:13 UTC) #28
michaeln
The CQ bit was checked by michaeln@chromium.org
6 years, 5 months ago (2014-07-19 07:01:00 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/michaeln@chromium.org/380093002/420001
6 years, 5 months ago (2014-07-19 07:01:09 UTC) #30
commit-bot: I haz the power
6 years, 5 months ago (2014-07-19 12:46:45 UTC) #31
Message was sent while issue was closed.
Change committed as 284329

Powered by Google App Engine
This is Rietveld 408576698