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

Issue 2467223002: ServiceWorker: Add a check if error handler runs on the right thread (Closed)

Created:
4 years, 1 month ago by shimazu
Modified:
4 years, 1 month ago
Reviewers:
falken, nhiroki, horo
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: Add a check if error handler runs on the right thread As observation in https://crbug.com/658702, I found the mojo error handler (EWInstance::Detach in this case) is called on the UI thread when the message loop on the UI thread gets destructed though EWInstance is on the IO thread. This patch is to check the running thread before the error handling to avoid unexpected threading issues. BUG=658702, 604762 Committed: https://crrev.com/be675544ee93b8f940230861a8a4ae1dbbf2ebc7 Cr-Commit-Position: refs/heads/master@{#430208}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Added DCHECK #

Patch Set 3 : Call EWInstance::Detach as an error handler from outside of EWInstance #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -1 line) Patch
M content/browser/service_worker/embedded_worker_instance.cc View 1 2 2 chunks +12 lines, -1 line 2 comments Download

Messages

Total messages: 35 (15 generated)
shimazu
ptal
4 years, 1 month ago (2016-11-02 05:26:53 UTC) #4
falken
drive-by comment: The code change is hard to understand from the CL description. It's removing ...
4 years, 1 month ago (2016-11-02 05:31:02 UTC) #6
shimazu
On 2016/11/02 05:31:02, falken wrote: > drive-by comment: The code change is hard to understand ...
4 years, 1 month ago (2016-11-02 07:34:34 UTC) #10
falken
On 2016/11/02 07:34:34, shimazu wrote: > On 2016/11/02 05:31:02, falken wrote: > > drive-by comment: ...
4 years, 1 month ago (2016-11-02 07:43:14 UTC) #11
horo
https://codereview.chromium.org/2467223002/diff/1/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2467223002/diff/1/content/browser/service_worker/embedded_worker_instance.cc#newcode820 content/browser/service_worker/embedded_worker_instance.cc:820: return; Please add DCHECK for mojo sw. if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) ...
4 years, 1 month ago (2016-11-02 07:49:13 UTC) #12
falken
Um, sorry I totally misread the patch. Somehow I thought it's deleting the code but ...
4 years, 1 month ago (2016-11-02 07:49:39 UTC) #13
nhiroki
https://codereview.chromium.org/2467223002/diff/1/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2467223002/diff/1/content/browser/service_worker/embedded_worker_instance.cc#newcode817 content/browser/service_worker/embedded_worker_instance.cc:817: // message loop on the UI thread gets destructed. ...
4 years, 1 month ago (2016-11-02 07:59:50 UTC) #15
horo
https://codereview.chromium.org/2467223002/diff/1/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2467223002/diff/1/content/browser/service_worker/embedded_worker_instance.cc#newcode817 content/browser/service_worker/embedded_worker_instance.cc:817: // message loop on the UI thread gets destructed. ...
4 years, 1 month ago (2016-11-02 08:22:54 UTC) #16
shimazu
On 2016/11/02 08:22:54, horo wrote: > https://codereview.chromium.org/2467223002/diff/1/content/browser/service_worker/embedded_worker_instance.cc > File content/browser/service_worker/embedded_worker_instance.cc (right): > > https://codereview.chromium.org/2467223002/diff/1/content/browser/service_worker/embedded_worker_instance.cc#newcode817 > ...
4 years, 1 month ago (2016-11-02 08:30:39 UTC) #17
nhiroki
lgtm https://codereview.chromium.org/2467223002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2467223002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc#newcode124 content/browser/service_worker/embedded_worker_instance.cc:124: void CallDetach(EmbeddedWorkerInstance* instance) { Just to confirm: A ...
4 years, 1 month ago (2016-11-02 08:42:40 UTC) #18
shimazu
On 2016/11/02 08:42:40, nhiroki wrote: > lgtm > > https://codereview.chromium.org/2467223002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc > File content/browser/service_worker/embedded_worker_instance.cc (right): > ...
4 years, 1 month ago (2016-11-02 08:48:05 UTC) #19
horo
lgtm
4 years, 1 month ago (2016-11-04 01:06:21 UTC) #20
shimazu
https://codereview.chromium.org/2467223002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc File content/browser/service_worker/embedded_worker_instance.cc (right): https://codereview.chromium.org/2467223002/diff/40001/content/browser/service_worker/embedded_worker_instance.cc#newcode124 content/browser/service_worker/embedded_worker_instance.cc:124: void CallDetach(EmbeddedWorkerInstance* instance) { On 2016/11/02 08:42:39, nhiroki (OOO ...
4 years, 1 month ago (2016-11-04 01:09:22 UTC) #21
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/2467223002/40001
4 years, 1 month ago (2016-11-04 01:10:09 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/325225)
4 years, 1 month ago (2016-11-04 04:11:55 UTC) #25
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/2467223002/40001
4 years, 1 month ago (2016-11-04 05:05:07 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/325426)
4 years, 1 month ago (2016-11-04 08:34:47 UTC) #29
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/2467223002/40001
4 years, 1 month ago (2016-11-06 23:53:21 UTC) #31
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 1 month ago (2016-11-07 01:38:42 UTC) #33
commit-bot: I haz the power
4 years, 1 month ago (2016-11-07 01:47:56 UTC) #35
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/be675544ee93b8f940230861a8a4ae1dbbf2ebc7
Cr-Commit-Position: refs/heads/master@{#430208}

Powered by Google App Engine
This is Rietveld 408576698