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

Issue 1569773002: ServiceWorker: Make start worker sequence cancelable (Closed)

Created:
4 years, 11 months ago by nhiroki
Modified:
4 years, 11 months ago
Reviewers:
falken
CC:
chromium-reviews, michaeln, jsbell+serviceworker_chromium.org, tzik, serviceworker-reviews, jam, kinuko+serviceworker, darin-cc_chromium.org, horo+watch_chromium.org, kinuko+watch, blink-worker-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: Make start worker sequence cancelable Before this patch, there is no way to gracefully cancel the start sequence when the worker is requested to stop. Therefore, both start and stop sequences can be interleaved. To be more specific, process allocation information can be left in ServiceWorkerProcessManager even after the start sequence is canceled, and the process manager sometimes behaves strangely when attempting to restart the worker. This patch provides a way to cancel the start sequence. <Details of this patch> Roughly speaking, the start sequence consists of two phases: (1) process allocation involving thread hops, and (2) IPC messaging between the browser process and a worker process. We need to make it cancelable in either phase. To achieve that, this patch introduces... * StartTask that is a cancelable task to allocate a worker process and to send a start worker message. * WorkerProcessHandle that is a handle for a worker process managed by ServiceWorkerProcessManager. Its dtor makes sure to release a process. The handle is created by StartTask when a process is allocated, and then passed to EmbeddedWorkerInstance. When the start sequence is aborted during the phase (1), StartTask releases a process on its dtor. When the start sequence is aborted during the phase (2), EmbeddedWorkerInstance releases the process by destroying the process handle. BUG=568915, 568465 Committed: https://crrev.com/516d5df07faad532cae29db7d525c99ac6b3c691 Cr-Commit-Position: refs/heads/master@{#369387}

Patch Set 1 : #

Patch Set 2 : fix test failures #

Patch Set 3 : fix test failures #

Total comments: 8

Patch Set 4 : address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+482 lines, -204 lines) Patch
M content/browser/service_worker/embedded_worker_instance.h View 8 chunks +25 lines, -28 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 1 2 3 14 chunks +233 lines, -113 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance_unittest.cc View 1 2 3 6 chunks +219 lines, -60 lines 0 comments Download
M content/browser/service_worker/service_worker_process_manager.cc View 1 chunk +5 lines, -3 lines 0 comments Download

Messages

Total messages: 49 (39 generated)
nhiroki
Hi, can you review this? Thanks!
4 years, 11 months ago (2016-01-13 08:03:51 UTC) #28
nhiroki
Hmm... this patch seems to change behavior of error cases. I'll investigate the cause of ...
4 years, 11 months ago (2016-01-13 08:31:43 UTC) #29
nhiroki
On 2016/01/13 08:31:43, nhiroki wrote: > Hmm... this patch seems to change behavior of error ...
4 years, 11 months ago (2016-01-14 04:31:19 UTC) #30
falken
lgtm This is an awesome patch, it should fix the races and makes the code ...
4 years, 11 months ago (2016-01-14 07:30:00 UTC) #31
nhiroki
Thank you for reviewing! https://codereview.chromium.org/1569773002/diff/380001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/1569773002/diff/380001/content/browser/service_worker/embedded_worker_instance.cc#newcode171 content/browser/service_worker/embedded_worker_instance.cc:171: // sequence. In the case, ...
4 years, 11 months ago (2016-01-14 08:43:40 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1569773002/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1569773002/400001
4 years, 11 months ago (2016-01-14 08:47:56 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1569773002/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1569773002/400001
4 years, 11 months ago (2016-01-14 08:50:25 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1569773002/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1569773002/400001
4 years, 11 months ago (2016-01-14 08:52:52 UTC) #45
commit-bot: I haz the power
Committed patchset #4 (id:400001)
4 years, 11 months ago (2016-01-14 10:25:15 UTC) #47
commit-bot: I haz the power
4 years, 11 months ago (2016-01-14 10:26:54 UTC) #49
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/516d5df07faad532cae29db7d525c99ac6b3c691
Cr-Commit-Position: refs/heads/master@{#369387}

Powered by Google App Engine
This is Rietveld 408576698