Device Service should be responsible to shut down the DeviceSensorService in appropriate time. |
|||
Issue descriptionThat 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.
,
Mar 6 2017
,
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
,
Mar 21 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by ke...@intel.com
, Mar 6 2017