New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 698664 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Mar 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 686706



Sign in to add a comment

Device Service should be responsible to shut down the DeviceSensorService in appropriate time.

Project Member Reported by ke...@intel.com, Mar 6 2017

Issue description

That shutdown currently occurs in //content's browser_main_loop.cc, with a comment saying that that shutdown has to occur after the IO thread shuts down, which is in turn after the service manager and Device Service shut down.

Per the discussion here: https://groups.google.com/a/chromium.org/forum/#!topic/services-dev/Y9FKZf9n1ls, the approach to be taken in this case is to move the shutdown in question to happen on the IO thread, keyed off that thread's destruction via MessageLoopObserver. This will remove the direct dependency from browser_main_loop.cc to DeviceSensorService.
 

Comment 1 by ke...@intel.com, Mar 6 2017

Blocking: 686706

Comment 2 by ke...@intel.com, Mar 6 2017

Status: Started (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0e3e0d1ec792363339551d3e26fce7fdf1e4cc83

commit 0e3e0d1ec792363339551d3e26fce7fdf1e4cc83
Author: ke.he <ke.he@intel.com>
Date: Thu Mar 16 13:54:12 2017

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}

[modify] https://crrev.com/0e3e0d1ec792363339551d3e26fce7fdf1e4cc83/content/browser/browser_main_loop.cc
[modify] https://crrev.com/0e3e0d1ec792363339551d3e26fce7fdf1e4cc83/device/sensors/device_sensor_service.cc
[modify] https://crrev.com/0e3e0d1ec792363339551d3e26fce7fdf1e4cc83/device/sensors/device_sensor_service.h

Comment 4 by ke...@intel.com, Mar 21 2017

Status: Fixed (was: Started)

Sign in to add a comment