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

Issue 417043006: ServiceWorker: Make SWProviderHost listen to SWRegistration (Closed)

Created:
6 years, 4 months ago by nhiroki
Modified:
6 years, 4 months ago
Reviewers:
michaeln, falken
CC:
chromium-reviews, michaeln, 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

ServiceWorker: Make SWProviderHost listen to SWRegistration This is a refactoring patch. Before this patch, ServiceWorkerRegisterJob is responsible for updating ServiceWorkerRegistration object and document's version attributes (ie. '.installing' etc) via ServiceWorkerProviderHost. This change makes the provider host implement Registration::Listener. Listers are notified when the registration is updated, so the register job no longer has to manage the version attributes. BUG=396400 TEST=content_unittests --gtest_filter=ServiceWorker* TEST=run_webkit_tests.py --debug http/tests/serviceworker Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288323

Patch Set 1 : #

Total comments: 6

Patch Set 2 : rebase #

Patch Set 3 : address falken's comments #

Total comments: 12

Patch Set 4 : address michael's comments #

Total comments: 20

Patch Set 5 : fix more #

Patch Set 6 : refactor #

Total comments: 2

Patch Set 7 : clean up #

Total comments: 4

Patch Set 8 : address michael's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+168 lines, -265 lines) Patch
M content/browser/service_worker/service_worker_controllee_request_handler.cc View 1 2 3 4 4 chunks +5 lines, -10 lines 0 comments Download
M content/browser/service_worker/service_worker_job_unittest.cc View 1 2 3 4 4 chunks +12 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.h View 1 2 3 4 6 chunks +36 lines, -10 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host.cc View 1 2 3 4 5 6 7 3 chunks +55 lines, -0 lines 0 comments Download
M content/browser/service_worker/service_worker_provider_host_unittest.cc View 1 2 3 6 chunks +26 lines, -150 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job.h View 1 2 3 4 2 chunks +3 lines, -16 lines 0 comments Download
M content/browser/service_worker/service_worker_register_job.cc View 1 2 3 4 5 6 7 5 chunks +11 lines, -70 lines 0 comments Download
M content/browser/service_worker/service_worker_registration.h View 1 2 3 4 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_registration.cc View 1 2 3 4 4 chunks +5 lines, -6 lines 0 comments Download
M content/browser/service_worker/service_worker_registration_unittest.cc View 1 2 3 4 2 chunks +9 lines, -1 line 0 comments Download
M content/browser/service_worker/service_worker_url_request_job_unittest.cc View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 18 (0 generated)
nhiroki
Hi, can you review this? I'd like to clean up Registration/ProviderHost relations before implementing version ...
6 years, 4 months ago (2014-08-01 06:06:06 UTC) #1
falken
lgtm https://codereview.chromium.org/417043006/diff/40001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/417043006/diff/40001/content/browser/service_worker/service_worker_provider_host.cc#newcode221 content/browser/service_worker/service_worker_provider_host.cc:221: if (!context_ || associated_registration_) nit: Since AssociateRegistration only ...
6 years, 4 months ago (2014-08-05 02:41:28 UTC) #2
nhiroki
Thank you for your comments! https://codereview.chromium.org/417043006/diff/40001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/417043006/diff/40001/content/browser/service_worker/service_worker_provider_host.cc#newcode221 content/browser/service_worker/service_worker_provider_host.cc:221: if (!context_ || associated_registration_) ...
6 years, 4 months ago (2014-08-05 15:51:13 UTC) #3
michaeln
https://codereview.chromium.org/417043006/diff/100001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (right): https://codereview.chromium.org/417043006/diff/100001/content/browser/service_worker/service_worker_provider_host.h#newcode51 content/browser/service_worker/service_worker_provider_host.h:51: // ServiceWorkerRegistration::Listener overrides. please put this in the private ...
6 years, 4 months ago (2014-08-05 23:57:16 UTC) #4
nhiroki
Thank you for reviewing. PTAL. falken@: Can you take another look, too? I think this ...
6 years, 4 months ago (2014-08-06 06:57:27 UTC) #5
falken
https://codereview.chromium.org/417043006/diff/100001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/417043006/diff/100001/content/browser/service_worker/service_worker_register_job.cc#newcode379 content/browser/service_worker/service_worker_register_job.cc:379: if (!registration()->active_version()) { On 2014/08/06 06:57:27, nhiroki wrote: > ...
6 years, 4 months ago (2014-08-06 16:09:35 UTC) #6
nhiroki
Reply only. Will update the patch soon... https://codereview.chromium.org/417043006/diff/100001/content/browser/service_worker/service_worker_register_job.cc File content/browser/service_worker/service_worker_register_job.cc (right): https://codereview.chromium.org/417043006/diff/100001/content/browser/service_worker/service_worker_register_job.cc#newcode379 content/browser/service_worker/service_worker_register_job.cc:379: if (!registration()->active_version()) ...
6 years, 4 months ago (2014-08-07 01:27:59 UTC) #7
michaeln
https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.cc#newcode222 content/browser/service_worker/service_worker_provider_host.cc:222: bool ServiceWorkerProviderHost::CanAssociateVersion( i think this check gets simplified to ...
6 years, 4 months ago (2014-08-07 01:34:35 UTC) #8
nhiroki
Thanks! Updated. https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.cc#newcode222 content/browser/service_worker/service_worker_provider_host.cc:222: bool ServiceWorkerProviderHost::CanAssociateVersion( On 2014/08/07 01:34:35, michaeln wrote: ...
6 years, 4 months ago (2014-08-07 02:57:27 UTC) #9
nhiroki
https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (right): https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.h#newcode86 content/browser/service_worker/service_worker_provider_host.h:86: void SetRegistration(ServiceWorkerRegistration* registration); On 2014/08/07 02:57:27, nhiroki wrote: > ...
6 years, 4 months ago (2014-08-07 03:13:54 UTC) #10
falken
Thanks for the explanations. LGTM https://codereview.chromium.org/417043006/diff/220001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/417043006/diff/220001/content/browser/service_worker/service_worker_provider_host.cc#newcode186 content/browser/service_worker/service_worker_provider_host.cc:186: if (associated_registration_) Now this ...
6 years, 4 months ago (2014-08-07 03:59:28 UTC) #11
nhiroki
https://codereview.chromium.org/417043006/diff/220001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/417043006/diff/220001/content/browser/service_worker/service_worker_provider_host.cc#newcode186 content/browser/service_worker/service_worker_provider_host.cc:186: if (associated_registration_) On 2014/08/07 03:59:26, falken wrote: > Now ...
6 years, 4 months ago (2014-08-07 04:10:43 UTC) #12
michaeln
lgtm https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.h File content/browser/service_worker/service_worker_provider_host.h (right): https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.h#newcode86 content/browser/service_worker/service_worker_provider_host.h:86: void SetRegistration(ServiceWorkerRegistration* registration); On 2014/08/07 03:13:54, nhiroki wrote: ...
6 years, 4 months ago (2014-08-07 20:33:07 UTC) #13
nhiroki
On 2014/08/07 20:33:07, michaeln wrote: > lgtm > > https://codereview.chromium.org/417043006/diff/140001/content/browser/service_worker/service_worker_provider_host.h > File content/browser/service_worker/service_worker_provider_host.h (right): > ...
6 years, 4 months ago (2014-08-08 06:31:10 UTC) #14
nhiroki
https://codereview.chromium.org/417043006/diff/240001/content/browser/service_worker/service_worker_provider_host.cc File content/browser/service_worker/service_worker_provider_host.cc (right): https://codereview.chromium.org/417043006/diff/240001/content/browser/service_worker/service_worker_provider_host.cc#newcode202 content/browser/service_worker/service_worker_provider_host.cc:202: SetWaitingVersion(NULL); On 2014/08/07 20:33:07, michaeln wrote: > i think ...
6 years, 4 months ago (2014-08-08 06:31:45 UTC) #15
nhiroki
The CQ bit was checked by nhiroki@chromium.org
6 years, 4 months ago (2014-08-08 06:33:06 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/nhiroki@chromium.org/417043006/260001
6 years, 4 months ago (2014-08-08 06:36:44 UTC) #17
commit-bot: I haz the power
6 years, 4 months ago (2014-08-08 10:55:43 UTC) #18
Message was sent while issue was closed.
Change committed as 288323

Powered by Google App Engine
This is Rietveld 408576698