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

Issue 2703153002: ServiceWorker: ignore AddMessageToConsole before process allocation (Closed)

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

Description

ServiceWorker: ignore AddMessageToConsole before process allocation This patch is to skip EmbeddedWorkerInstance::AddMessageToConsole before process is allocated. When test is finishing, a renderer process on which the worker's script loading is running is killed. This cancels the ServiceWorkerWriteToCacheJob URLRequestJob. So ServiceWorkerWriteToCacheJob::NotifyFinishedCaching() calls EmbeddedWorkerInstance::AddMessageToConsole. At the same time with finishing, ClearAllServiceWorkersForTest calls SWVersion::StopWorker. This causes a situation that EmbeddedWorkerInstance is in the STARTING state, due to the restart behavior of Stop, but not yet have a process when AddMessageToConsole is called. So AddMessageToConsole would crash. BUG=692439 Review-Url: https://codereview.chromium.org/2703153002 Cr-Commit-Position: refs/heads/master@{#451733} Committed: https://chromium.googlesource.com/chromium/src/+/acc713786ac1643648471dd35083ce760dcdfd30

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed falken@'s comment #

Patch Set 3 : remove unnecessary if #

Total comments: 2

Patch Set 4 : Use process_id() instead of switch statement #

Unified diffs Side-by-side diffs Delta from patch set Stats (+72 lines, -3 lines) Patch
M content/browser/service_worker/embedded_worker_instance.cc View 1 2 3 1 chunk +1 line, -3 lines 0 comments Download
M content/browser/service_worker/embedded_worker_instance_unittest.cc View 1 1 chunk +71 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (15 generated)
shimazu
ptal
3 years, 10 months ago (2017-02-20 06:35:14 UTC) #4
falken
Thanks for writing the CL description but I'm a little confused: there is no SWVersion::Stop(). ...
3 years, 10 months ago (2017-02-20 08:01:03 UTC) #5
falken
https://codereview.chromium.org/2703153002/diff/1/content/browser/service_worker/embedded_worker_instance_unittest.cc File content/browser/service_worker/embedded_worker_instance_unittest.cc (right): https://codereview.chromium.org/2703153002/diff/1/content/browser/service_worker/embedded_worker_instance_unittest.cc#newcode775 content/browser/service_worker/embedded_worker_instance_unittest.cc:775: // Let StartWorker fail; binding is discarded in the ...
3 years, 10 months ago (2017-02-20 08:07:13 UTC) #6
falken
https://codereview.chromium.org/2703153002/diff/1/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2703153002/diff/1/content/browser/service_worker/embedded_worker_instance.cc#newcode878 content/browser/service_worker/embedded_worker_instance.cc:878: !HasSentStartWorker(starting_phase()))) { On 2017/02/20 08:01:03, falken wrote: > can ...
3 years, 10 months ago (2017-02-20 08:14:45 UTC) #9
shimazu
Updated. ptal again:) https://codereview.chromium.org/2703153002/diff/1/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2703153002/diff/1/content/browser/service_worker/embedded_worker_instance.cc#newcode878 content/browser/service_worker/embedded_worker_instance.cc:878: !HasSentStartWorker(starting_phase()))) { On 2017/02/20 08:14:45, falken ...
3 years, 10 months ago (2017-02-21 03:13:52 UTC) #12
shimazu
Updated. ptal again:) https://codereview.chromium.org/2703153002/diff/1/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2703153002/diff/1/content/browser/service_worker/embedded_worker_instance.cc#newcode878 content/browser/service_worker/embedded_worker_instance.cc:878: !HasSentStartWorker(starting_phase()))) { On 2017/02/20 08:14:45, falken ...
3 years, 10 months ago (2017-02-21 03:13:53 UTC) #13
falken
lgtm https://codereview.chromium.org/2703153002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2703153002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc#newcode884 content/browser/service_worker/embedded_worker_instance.cc:884: break; Sorry for keeping suggesting things. Would if ...
3 years, 10 months ago (2017-02-21 04:03:30 UTC) #16
shimazu
https://codereview.chromium.org/2703153002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2703153002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc#newcode884 content/browser/service_worker/embedded_worker_instance.cc:884: break; On 2017/02/21 04:03:30, falken wrote: > Sorry for ...
3 years, 10 months ago (2017-02-21 04:39:52 UTC) #19
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/2703153002/60001
3 years, 10 months ago (2017-02-21 04:40:01 UTC) #20
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/122895)
3 years, 10 months ago (2017-02-21 07:33:48 UTC) #22
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/2703153002/60001
3 years, 10 months ago (2017-02-21 09:36:06 UTC) #24
commit-bot: I haz the power
3 years, 10 months ago (2017-02-21 11:31:31 UTC) #27
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/acc713786ac1643648471dd35083...

Powered by Google App Engine
This is Rietveld 408576698