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

Issue 2578023002: ServiceWorker: Stop don't send a message before connection established (Closed)

Created:
4 years ago by shimazu
Modified:
3 years, 11 months ago
Reviewers:
falken, Mark P, nhiroki
CC:
chromium-reviews, michaeln, mlamouri+watch-content_chromium.org, tzik, jsbell+serviceworker_chromium.org, serviceworker-reviews, jam, kinuko+serviceworker, horo+watch_chromium.org, darin-cc_chromium.org, kinuko+watch, shimazu+serviceworker_chromium.org, blink-worker-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

ServiceWorker: Stop don't send a message before connection established Currently a callback passed on the second time is discarded when StopWorker message is sent twice. This patch fixes it by not calling EWInstance::Stop twice and not sending the StopWorker message before StartWorker message. BUG=674443 TEST= ./third_party/WebKit/Tools/Scripts/run-webkit-tests -t Master 'http/tests/serviceworker/chromium/resolve-after-window-close.html' --no-retry-failures --order=random --iterations=100 --exit-after-n-crashes-or-timeouts=1 Review-Url: https://codereview.chromium.org/2578023002 Cr-Commit-Position: refs/heads/master@{#441878} Committed: https://chromium.googlesource.com/chromium/src/+/840051ec723d7dcacc54b81b8c77957c8ce8dad3

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fixed more #

Patch Set 3 : Added DCHECKs #

Total comments: 16

Patch Set 4 : Addressed comments from nhiroki@ #

Total comments: 6

Patch Set 5 : Addressed comments from nhiroki@ #

Total comments: 8

Patch Set 6 : Don't call Stop twice and simplify the condition #

Patch Set 7 : Fixed wrong DCHECK #

Total comments: 10

Patch Set 8 : comment from falken@ #

Total comments: 6

Patch Set 9 : Updated comments #

Total comments: 4

Patch Set 10 : Rebase #

Patch Set 11 : Reset starting_phase when releasing the process #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -42 lines) Patch
M content/browser/service_worker/embedded_worker_instance.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -3 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +42 lines, -13 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +5 lines, -11 lines 0 comments Download
M content/browser/service_worker/service_worker_version.cc View 1 2 3 4 5 6 7 8 9 1 chunk +19 lines, -11 lines 0 comments Download
M content/renderer/service_worker/embedded_worker_instance_client_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -4 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 4 comments Download

Messages

Total messages: 67 (40 generated)
shimazu
ptal
4 years ago (2016-12-15 05:12:42 UTC) #2
nhiroki
https://codereview.chromium.org/2578023002/diff/1/content/renderer/service_worker/embedded_worker_instance_client_impl.cc File content/renderer/service_worker/embedded_worker_instance_client_impl.cc (left): https://codereview.chromium.org/2578023002/diff/1/content/renderer/service_worker/embedded_worker_instance_client_impl.cc#oldcode64 content/renderer/service_worker/embedded_worker_instance_client_impl.cc:64: DCHECK(embedded_worker_id_); Instead of removing this, can you move this ...
4 years ago (2016-12-15 05:43:26 UTC) #3
shimazu
Thanks for your comments! I've found other corner cases, so added more fixes. PTAL again! ...
4 years ago (2016-12-15 08:52:28 UTC) #6
nhiroki
https://codereview.chromium.org/2578023002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2578023002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc#newcode508 content/browser/service_worker/embedded_worker_instance.cc:508: SERVICE_WORKER_OK, Does StopWorker() always succeed? If so, do we ...
4 years ago (2016-12-15 09:53:15 UTC) #11
nhiroki
+falken@ because I'll be ooo tomorrow...
4 years ago (2016-12-15 09:54:15 UTC) #13
falken
I'd like to take a closer look after nhiroki's comments and the trybot failures are ...
4 years ago (2016-12-16 01:21:26 UTC) #14
shimazu
Thanks for your comments. I've forgotten to fix the test for the buildbot failures. PTAL. ...
4 years ago (2016-12-19 08:25:12 UTC) #18
nhiroki
https://codereview.chromium.org/2578023002/diff/40001/content/renderer/service_worker/embedded_worker_instance_client_impl.cc File content/renderer/service_worker/embedded_worker_instance_client_impl.cc (right): https://codereview.chromium.org/2578023002/diff/40001/content/renderer/service_worker/embedded_worker_instance_client_impl.cc#newcode34 content/renderer/service_worker/embedded_worker_instance_client_impl.cc:34: callback.Run(); On 2016/12/19 08:25:12, shimazu wrote: > On 2016/12/15 ...
4 years ago (2016-12-19 09:21:55 UTC) #19
shimazu
Thanks, updated. https://codereview.chromium.org/2578023002/diff/60001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2578023002/diff/60001/content/browser/service_worker/embedded_worker_instance.cc#newcode527 content/browser/service_worker/embedded_worker_instance.cc:527: default: On 2016/12/19 09:21:55, nhiroki wrote: > ...
4 years ago (2016-12-19 09:47:51 UTC) #21
nhiroki
I'll be ooo until next week, so let me leave this to falken... On 2016/12/19 ...
4 years ago (2016-12-19 10:02:38 UTC) #22
falken
Incrementally this change seems OK but I'm getting wary of the complexity added lately to ...
4 years ago (2016-12-20 04:41:31 UTC) #23
falken
https://codereview.chromium.org/2578023002/diff/100001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2578023002/diff/100001/content/browser/service_worker/embedded_worker_instance.cc#newcode498 content/browser/service_worker/embedded_worker_instance.cc:498: << static_cast<int>(status_); Also wouldn't this DCHECK fail if Stop() ...
4 years ago (2016-12-20 04:47:12 UTC) #24
shimazu
Thanks for your comments. Actually I was a bit confused by the state management... I've ...
4 years ago (2016-12-20 07:55:01 UTC) #37
falken
This is looking good, thanks for taking up the suggestion! Also I'm thinking about tests. ...
4 years ago (2016-12-20 09:12:07 UTC) #38
shimazu
Updated the patch. PTAL again:) https://codereview.chromium.org/2578023002/diff/40001/content/renderer/service_worker/embedded_worker_instance_client_impl.cc File content/renderer/service_worker/embedded_worker_instance_client_impl.cc (right): https://codereview.chromium.org/2578023002/diff/40001/content/renderer/service_worker/embedded_worker_instance_client_impl.cc#newcode34 content/renderer/service_worker/embedded_worker_instance_client_impl.cc:34: callback.Run(); On 2016/12/19 09:21:55, ...
3 years, 11 months ago (2017-01-05 06:02:42 UTC) #41
falken
Thanks, this is nice. lgtm. https://codereview.chromium.org/2578023002/diff/220001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2578023002/diff/220001/content/browser/service_worker/embedded_worker_instance.cc#newcode529 content/browser/service_worker/embedded_worker_instance.cc:529: // removed. for clarity, ...
3 years, 11 months ago (2017-01-05 06:40:17 UTC) #42
shimazu
mpearson@: could you check histogram.xml? https://codereview.chromium.org/2578023002/diff/220001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2578023002/diff/220001/content/browser/service_worker/embedded_worker_instance.cc#newcode529 content/browser/service_worker/embedded_worker_instance.cc:529: // removed. On 2017/01/05 ...
3 years, 11 months ago (2017-01-05 07:42:56 UTC) #44
nhiroki
lgtm https://codereview.chromium.org/2578023002/diff/240001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2578023002/diff/240001/content/browser/service_worker/embedded_worker_instance.cc#newcode527 content/browser/service_worker/embedded_worker_instance.cc:527: // been sent. Should we also avoid sending ...
3 years, 11 months ago (2017-01-05 08:32:57 UTC) #49
shimazu
https://codereview.chromium.org/2578023002/diff/240001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2578023002/diff/240001/content/browser/service_worker/embedded_worker_instance.cc#newcode527 content/browser/service_worker/embedded_worker_instance.cc:527: // been sent. On 2017/01/05 08:32:57, nhiroki wrote: > ...
3 years, 11 months ago (2017-01-05 08:48:59 UTC) #52
Mark P
https://codereview.chromium.org/2578023002/diff/280001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2578023002/diff/280001/tools/metrics/histograms/histograms.xml#newcode59367 tools/metrics/histograms/histograms.xml:59367: + This was previously recorded for both the IPC ...
3 years, 11 months ago (2017-01-05 20:11:09 UTC) #55
falken
https://codereview.chromium.org/2578023002/diff/280001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2578023002/diff/280001/tools/metrics/histograms/histograms.xml#newcode59367 tools/metrics/histograms/histograms.xml:59367: + This was previously recorded for both the IPC ...
3 years, 11 months ago (2017-01-06 02:14:54 UTC) #56
falken
I think Mark may be gone for the day. In the interest of moving this ...
3 years, 11 months ago (2017-01-06 03:05:38 UTC) #57
Mark P
histograms.xml lgtm --mark https://codereview.chromium.org/2578023002/diff/280001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2578023002/diff/280001/tools/metrics/histograms/histograms.xml#newcode59367 tools/metrics/histograms/histograms.xml:59367: + This was previously recorded for ...
3 years, 11 months ago (2017-01-06 04:52:43 UTC) #58
Mark P
On 2017/01/06 04:52:43, Mark P wrote: > histograms.xml lgtm (This comment applies to patchset 11. ...
3 years, 11 months ago (2017-01-06 04:54:13 UTC) #59
shimazu
https://codereview.chromium.org/2578023002/diff/280001/tools/metrics/histograms/histograms.xml File tools/metrics/histograms/histograms.xml (right): https://codereview.chromium.org/2578023002/diff/280001/tools/metrics/histograms/histograms.xml#newcode59367 tools/metrics/histograms/histograms.xml:59367: + This was previously recorded for both the IPC ...
3 years, 11 months ago (2017-01-06 04:58:23 UTC) #61
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/2578023002/280001
3 years, 11 months ago (2017-01-06 04:58:45 UTC) #64
commit-bot: I haz the power
3 years, 11 months ago (2017-01-06 05:03:17 UTC) #67
Message was sent while issue was closed.
Committed patchset #11 (id:280001) as
https://chromium.googlesource.com/chromium/src/+/840051ec723d7dcacc54b81b8c77...

Powered by Google App Engine
This is Rietveld 408576698