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

Issue 2730333002: Make DeviceSensorService implement MainLoop::DestructionObserver (Closed)

Created:
3 years, 9 months ago by ke.he
Modified:
3 years, 9 months ago
Reviewers:
jam, timvolodine, blundell
CC:
chromium-reviews, jam, darin-cc_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

The DeviceSensorService shutdown currently occurs after the IO thread shuts down in //content's browser_main_loop.cc. If we let the Device Sensor be hosted by DeviceService, we cannot find a right time to do the DeviceSensorService shutdown operation even as late as in destructor of DeviceService. So, in this patch we let DeviceSensorService observe the thread it is running on. For Non-Android platform, DeviceSensorService is run in IO thread. It shuts itself down when IO thread is going to close. For Android platform, the DeviceSensorService shutdown is only called when running browsertests, with this modification the shutdown is later (for browsertest) but still safe. BUG=698664 Review-Url: https://codereview.chromium.org/2730333002 Cr-Commit-Position: refs/heads/master@{#457422} Committed: https://chromium.googlesource.com/chromium/src/+/0e3e0d1ec792363339551d3e26fce7fdf1e4cc83

Patch Set 1 #

Patch Set 2 : Make Device Serive be responsible to shutdown DeviceSensorService. #

Patch Set 3 : Make Device Serive be responsible to shutdown DeviceSensorService. #

Patch Set 4 : shutdown in UI thread for Android. #

Total comments: 2

Patch Set 5 : Make Device Service be responsible to shutdown DeviceSensorService. #

Patch Set 6 : Make DeviceSensorService observes IOThread to shutdown in right time. #

Patch Set 7 : Make DeviceSensorService observes IOThread to shutdown in right time. #

Total comments: 4

Patch Set 8 : Make DeviceSensorService observes IOThread to shutdown in right time. #

Patch Set 9 : code rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -8 lines) Patch
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -5 lines 0 comments Download
M device/sensors/device_sensor_service.h View 1 2 3 4 5 6 7 4 chunks +7 lines, -2 lines 0 comments Download
M device/sensors/device_sensor_service.cc View 1 2 3 4 5 6 7 3 chunks +10 lines, -1 line 0 comments Download

Messages

Total messages: 70 (52 generated)
ke.he
Hi, Colin, So strange that it breaks the chrome uninstall on windows. The log shows ...
3 years, 9 months ago (2017-03-07 09:56:41 UTC) #22
blundell
Hi Ke He, This is great, thanks! I don't know why the win trybot is ...
3 years, 9 months ago (2017-03-07 16:14:36 UTC) #29
ke.he
Hi, Colin, PTAL. By the way the windows uninstall is because of in-stable of trybot. ...
3 years, 9 months ago (2017-03-08 09:19:55 UTC) #36
blundell
Great, thanks! One question below. https://codereview.chromium.org/2730333002/diff/120001/services/device/device_service.cc File services/device/device_service.cc (right): https://codereview.chromium.org/2730333002/diff/120001/services/device/device_service.cc#newcode43 services/device/device_service.cc:43: TRACE_EVENT0("shutdown", "DeviceService::Subsystem:SensorService"); On 2017/03/08 ...
3 years, 9 months ago (2017-03-08 17:38:18 UTC) #39
ke.he
https://codereview.chromium.org/2730333002/diff/120001/services/device/device_service.cc File services/device/device_service.cc (right): https://codereview.chromium.org/2730333002/diff/120001/services/device/device_service.cc#newcode43 services/device/device_service.cc:43: TRACE_EVENT0("shutdown", "DeviceService::Subsystem:SensorService"); For Android platform, DeviceSensorService runs in UI ...
3 years, 9 months ago (2017-03-09 02:37:33 UTC) #40
blundell
On 2017/03/09 02:37:33, ke.he wrote: > https://codereview.chromium.org/2730333002/diff/120001/services/device/device_service.cc > File services/device/device_service.cc (right): > > https://codereview.chromium.org/2730333002/diff/120001/services/device/device_service.cc#newcode43 > ...
3 years, 9 months ago (2017-03-09 16:06:58 UTC) #41
ke.he
On 2017/03/09 16:06:58, blundell (OOO until March 13) wrote: > On 2017/03/09 02:37:33, ke.he wrote: ...
3 years, 9 months ago (2017-03-13 08:39:44 UTC) #46
blundell
On 2017/03/13 08:39:44, ke.he wrote: > On 2017/03/09 16:06:58, blundell (OOO until March 13) wrote: ...
3 years, 9 months ago (2017-03-13 15:47:46 UTC) #47
ke.he
Colin, PTAL, Thanks.
3 years, 9 months ago (2017-03-14 13:49:14 UTC) #55
blundell
lgtm +Tim
3 years, 9 months ago (2017-03-14 17:20:39 UTC) #58
ke.he
Also add Jam@ since we changed browser_main_loop.cc.
3 years, 9 months ago (2017-03-15 06:18:56 UTC) #60
jam
lgtm
3 years, 9 months ago (2017-03-15 17:07:18 UTC) #61
timvolodine
On 2017/03/15 17:07:18, jam wrote: > lgtm ke.he@ : just to double check I assume ...
3 years, 9 months ago (2017-03-15 17:22:34 UTC) #62
ke.he
On 2017/03/15 17:22:34, timvolodine wrote: > On 2017/03/15 17:07:18, jam wrote: > > lgtm > ...
3 years, 9 months ago (2017-03-16 01:33:35 UTC) #63
blundell
On 2017/03/16 01:33:35, ke.he wrote: > On 2017/03/15 17:22:34, timvolodine wrote: > > On 2017/03/15 ...
3 years, 9 months ago (2017-03-16 08:28:59 UTC) #64
timvolodine
On 2017/03/16 08:28:59, blundell wrote: > On 2017/03/16 01:33:35, ke.he wrote: > > On 2017/03/15 ...
3 years, 9 months ago (2017-03-16 13:00:50 UTC) #65
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/2730333002/160001
3 years, 9 months ago (2017-03-16 13:07:03 UTC) #67
commit-bot: I haz the power
3 years, 9 months ago (2017-03-16 13:55:04 UTC) #70
Message was sent while issue was closed.
Committed patchset #9 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/0e3e0d1ec792363339551d3e26fc...

Powered by Google App Engine
This is Rietveld 408576698