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

Issue 612322 link

Starred by 8 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task


Sign in to add a comment

Eliminate //device/sensors

Project Member Reported by jam@chromium.org, May 16 2016

Issue description

Tracking bug for the device sensors part of the Content Modularization Project. The end goal should be to have a self-contained service. As part of getting rid (or greatly reducing) content/, this code should move out of content/. Most likely to device/sensors to be consistent with what's being done for battery, bluetooth, nfc, serial, usb, vibration etc...
 

Comment 1 by jam@chromium.org, May 16 2016

Cc: timvolod...@chromium.org

Comment 2 by jam@chromium.org, May 16 2016

Blocking: 612328

Comment 3 by jam@chromium.org, May 17 2016

Strawman proposal, following other services that we're extracting from content:
-convert IPCs to mojo
-eliminate the dependencies in this code on other code in content/
-move remaining code in content/{browser,common}/device_sensors to device/device_sensors

Comment 4 by jam@chromium.org, May 17 2016

Blocking: -598073 598069

Comment 5 by lunalu@chromium.org, Sep 16 2016

Owner: lunalu@chromium.org
Status: Assigned (was: Available)
It is already using mojo
What is left is to remove code from content/renderer/device_sensors and connect directly to Blink 
 
lunalu@ -- It's awesome that you're interested! Before starting work, could you just coordinate with timvolodine@? He had also expressed interest in doing this decoupling, but wasn't sure when/if he was going to have the cycles.

The browser-side code also needs to be decoupled and moved to //device/sensors. Are you interested in doing that work as well, or is your interest only on the renderer side?

Thanks!

Comment 7 by lunalu@chromium.org, Sep 19 2016

blundell@ I am interested in both browser-side and renderer-side. 

Awesome! I suggest starting by posting a short design doc to this bug describing the dependencies and how you plan to remove them.
Hi lunalu@, I'm highly interested in having design docs for all the remaining Device Service work ASAP to estimate the amount of work involved. Would you be able to do the design doc for device sensors in the next week or so, or should I take an initial crack at it (i.e., just the design doc part, it's OK if the technical work lags behind)? 
Cc: alexis.m...@intel.com
Owner: blundell@chromium.org
After discussion offline with lunalu@, I'm going to take this one. alexis.menard@intel.com also has a related patch: https://codereview.chromium.org/2358123005/. Alexis, were you hoping to do further device sensors work after that patch?
Yes, I'm hoping to work more on sensors and device. After I land macOS ambient light, I plan to do the motion/accelerometer and continue forward (other work or OSes).
Hi Alexis, would you like to own this bug then :) ?
Sure, so it would be moving content/browser-renderer-common classes in device/sensors and make sure there is nothing else in content/ depending on anything I'm moving. Right? Should we call it device/sensors or something else? We have generic_sensor also, it kinda confusion. Btw, any hard timeline on this? I prefer to move forward the implementation in generic_sensors/ first...


Hi Alexis,

I'll keep this one as I'd like to get it out of the way soon. From looking at it briefly today, I think that your move of the synch primitives to //device eliminated the last big blocker. Thanks!
Status: Started (was: Assigned)
Project Member

Comment 16 by bugdroid1@chromium.org, Oct 10 2016

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

commit b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7
Author: blundell <blundell@chromium.org>
Date: Mon Oct 10 16:05:28 2016

Move device_sensors cross-process headers out of //content

In preparation for migrating the implementation of
//device/sensors/public/interfaces down from //content/browser
into //device, this CL moves the headers shared between that implementation
and its client from //content/common/device_sensors into
//device/sensors/public/cpp.

I have left these headers in the //content namespace for now as they're
widely used by code that will also move. I'll move their namespace in
one go together with the rest of the code that's moving.

The Blink headers referenced from these ones should also move to sit next
to these ones.

BUG= 612322 

Review-Url: https://codereview.chromium.org/2389963003
Cr-Commit-Position: refs/heads/master@{#424160}

[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/BUILD.gn
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/device_sensors/data_fetcher_shared_memory.h
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/device_sensors/data_fetcher_shared_memory_android.cc
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/device_sensors/data_fetcher_shared_memory_base.cc
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/device_sensors/data_fetcher_shared_memory_base_unittest.cc
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/device_sensors/device_sensor_browsertest.cc
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/device_sensors/sensor_manager_android.h
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/device_sensors/sensor_manager_chromeos.h
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/browser/device_sensors/sensor_manager_chromeos_unittest.cc
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/common/BUILD.gn
[delete] https://crrev.com/7671a428c156f12794db7e7d35d0709b8bb3df35/content/common/device_sensors/OWNERS
[delete] https://crrev.com/7671a428c156f12794db7e7d35d0709b8bb3df35/content/common/device_sensors/device_light_hardware_buffer.h
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/renderer/BUILD.gn
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/renderer/device_sensors/device_light_event_pump.h
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/renderer/device_sensors/device_light_event_pump_unittest.cc
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/renderer/device_sensors/device_motion_event_pump_unittest.cc
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
[modify] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/content/test/BUILD.gn
[add] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/device/sensors/public/cpp/BUILD.gn
[add] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/device/sensors/public/cpp/DEPS
[rename] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/device/sensors/public/cpp/device_light_data.h
[add] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/device/sensors/public/cpp/device_light_hardware_buffer.h
[rename] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/device/sensors/public/cpp/device_motion_hardware_buffer.h
[rename] https://crrev.com/b8138c3c83c74bd313d48f5bb0e90fbfd5e1ddc7/device/sensors/public/cpp/device_orientation_hardware_buffer.h

Project Member

Comment 17 by bugdroid1@chromium.org, Nov 16 2016

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

commit 4489ef7781fd694d199e2c5a407f0614317de2d7
Author: blundell <blundell@chromium.org>
Date: Wed Nov 16 11:00:09 2016

[Device Sensors] Move Mojo communication to UI thread on Android

In preparation for removing content::BrowserThread knowledge from
Device Sensors, this CL eliminates the need for SensorManagerAndroid to
live on multiple threads. Instead, Mojo communication for Device Sensors
occurs on the UI thread on Android, resulting in the following structure:

- On Android, all of the device sensors host code lives solely on the
UI thread.
- On all other platforms, all of the device sensors host code lives
solely on the IO thread.

This restructure will enable a straightforward followup that replaces
usage of content::BrowserThread with //base-level primitives in this code.

Note that device_sensor_browsertest.cc had to be updated to support this
change:
- Could no longer use WaitableEvents, as they blocked the UI thread while
  waiting for incoming Mojo communication, which on Android is now incoming
  on the UI thread :P.
- Instead, the tests spin up run loops and pass their QuitClosures into
  the FakeDataFetcher, which calls those QuitClosures on the UI thread when
  the appropriate events occur. In this way, the tests can wait for the
  various events (by Running the appropriate RunLoop) regardless of whether
  the Mojo communication (and FakeDataFetcher) live on the UI or IO thread.

BUG= 612322 

Review-Url: https://codereview.chromium.org/2416123003
Cr-Commit-Position: refs/heads/master@{#432455}

[modify] https://crrev.com/4489ef7781fd694d199e2c5a407f0614317de2d7/content/browser/device_sensors/device_sensor_browsertest.cc
[modify] https://crrev.com/4489ef7781fd694d199e2c5a407f0614317de2d7/content/browser/device_sensors/device_sensor_host.cc
[modify] https://crrev.com/4489ef7781fd694d199e2c5a407f0614317de2d7/content/browser/device_sensors/sensor_manager_android.cc
[modify] https://crrev.com/4489ef7781fd694d199e2c5a407f0614317de2d7/content/browser/device_sensors/sensor_manager_android.h
[modify] https://crrev.com/4489ef7781fd694d199e2c5a407f0614317de2d7/content/browser/renderer_host/render_process_host_impl.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Nov 17 2016

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

commit 8a86a47aa16fcc5236bef6f4e99e1880c180fd4f
Author: blundell <blundell@chromium.org>
Date: Thu Nov 17 09:15:20 2016

[Device Sensors] Remove BrowserThread knowledge

Following the restructuring of Device Sensors Mojo communication to
occur on the UI thread on Android, it is now totally straightforward
to remove content::BrowserThread knowledge from the Device Sensors code.
This change will facilitate moving //content/browser/device_sensors to
//device/sensors in a followup as part of the servicification of
//content's device-related code.

BUG= 612322 

Review-Url: https://codereview.chromium.org/2452083002
Cr-Commit-Position: refs/heads/master@{#432825}

[modify] https://crrev.com/8a86a47aa16fcc5236bef6f4e99e1880c180fd4f/content/browser/device_sensors/device_sensor_host.cc
[modify] https://crrev.com/8a86a47aa16fcc5236bef6f4e99e1880c180fd4f/content/browser/device_sensors/sensor_manager_android.cc
[modify] https://crrev.com/8a86a47aa16fcc5236bef6f4e99e1880c180fd4f/content/browser/device_sensors/sensor_manager_android.h
[modify] https://crrev.com/8a86a47aa16fcc5236bef6f4e99e1880c180fd4f/content/browser/device_sensors/sensor_manager_android_unittest.cc

Labels: DeviceService
Owner: ke...@intel.com
Blockedon: 686706
Blockedon: 686707
Project Member

Comment 23 by bugdroid1@chromium.org, Feb 2 2017

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

commit 48ce2ae57a453067012e318d07a44bafe6c752b1
Author: ke.he <ke.he@intel.com>
Date: Thu Feb 02 15:31:32 2017

Move //content/browser/device_sensor/ into device/sensors

This patch moves device_sensor related files out of //content/browser and into
//device/sensors. In next patch we will port it into Device Service.

The file DeviceSensors.java and DeviceSensorsTest.java are also moved into
//device. The device_sensor_browsertest.cc is still in
//content/browser/device_sensor/

BUG= 612322 

Review-Url: https://codereview.chromium.org/2646093002
Cr-Commit-Position: refs/heads/master@{#447770}

[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/app/BUILD.gn
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/app/DEPS
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/app/android/library_loader_hooks.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/browser/BUILD.gn
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/browser/DEPS
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/browser/android/browser_jni_registrar.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/browser/browser_main_loop.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/browser/device_sensors/DEPS
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/browser/device_sensors/device_sensor_browsertest.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/browser/renderer_host/render_process_host_impl.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/common/BUILD.gn
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/public/android/BUILD.gn
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/renderer/BUILD.gn
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/renderer/device_sensors/device_light_event_pump.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/renderer/device_sensors/device_light_event_pump.h
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/renderer/device_sensors/device_light_event_pump_unittest.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/renderer/device_sensors/device_motion_event_pump_unittest.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/shell/android/BUILD.gn
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/content/test/BUILD.gn
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/BUILD.gn
[add] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/BUILD.gn
[add] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/DEPS
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/ambient_light_mac.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/ambient_light_mac.h
[add] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/android/device_sensor_jni_registrar.cc
[add] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/android/device_sensor_jni_registrar.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/android/java/src/org/chromium/device/sensors/DeviceSensors.java
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/android/javatests/src/org/chromium/device/sensors/DeviceSensorsTest.java
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory_android.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory_base.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory_base.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory_base_unittest.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory_chromeos.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory_default.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory_mac.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/data_fetcher_shared_memory_win.cc
[add] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/device_sensor_export.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/device_sensor_host.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/device_sensor_host.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/device_sensor_service.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/device_sensor_service.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/device_sensors_consts.h
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/public/cpp/device_light_data.h
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/public/cpp/device_light_hardware_buffer.h
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/public/cpp/device_motion_hardware_buffer.h
[modify] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/public/cpp/device_orientation_hardware_buffer.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/sensor_manager_android.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/sensor_manager_android.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/sensor_manager_android_unittest.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/sensor_manager_chromeos.cc
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/sensor_manager_chromeos.h
[rename] https://crrev.com/48ce2ae57a453067012e318d07a44bafe6c752b1/device/sensors/sensor_manager_chromeos_unittest.cc

Project Member

Comment 24 by bugdroid1@chromium.org, Feb 17 2017

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

commit f6fb3e420e012be507b027e747dc819d7fb4da73
Author: ke.he <ke.he@intel.com>
Date: Fri Feb 17 04:28:46 2017

git cl format //device/sensors

After we moved the //content/browser/device_sensors to //device/sensors,
we use this separate CL to do "git cl formatting".
The log tag "cr.sensors" is changed into "sensors" in DeviceSensors.java to
eliminates the presubmit warnings.

BUG= 612322 

Review-Url: https://codereview.chromium.org/2674613003
Cr-Commit-Position: refs/heads/master@{#451208}

[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/ambient_light_mac.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/android/java/src/org/chromium/device/sensors/DeviceSensors.java
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/android/javatests/src/org/chromium/device/sensors/DeviceSensorsTest.java
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/data_fetcher_shared_memory.h
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/data_fetcher_shared_memory_android.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/data_fetcher_shared_memory_base.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/data_fetcher_shared_memory_base_unittest.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/data_fetcher_shared_memory_chromeos.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/data_fetcher_shared_memory_default.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/data_fetcher_shared_memory_mac.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/data_fetcher_shared_memory_win.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/sensor_manager_android.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/sensor_manager_android_unittest.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/sensor_manager_chromeos.cc
[modify] https://crrev.com/f6fb3e420e012be507b027e747dc819d7fb4da73/device/sensors/sensor_manager_chromeos_unittest.cc

Comment 25 by ke...@intel.com, Feb 22 2017

Blockedon: 694888
Project Member

Comment 26 by bugdroid1@chromium.org, Mar 21 2017

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

commit 241fad6fdac74b820fa21e29652bbae49239840e
Author: blundell <blundell@chromium.org>
Date: Tue Mar 21 11:14:38 2017

Move Device Sensors client files from Blink to //device/sensors client lib

Currently, several Device Sensors files are part of the WebKit public
API. These files define POD structs that the Device Sensors implementation
and its clients use to consistently interpret shared memory.

As part of servicificying Device Sensors and enabling it to be used
by clients other than Blink, this CL moves those files into the Device
Sensors client library. It also updates naming conventions etc. to match
their new location.

Once concern in making this move is that Blink's modules implementations
cannot in general depend on Chromium code due to performance concerns. In
this particular case, the dependence is both necessary (for the
interpretation of shared memory) and safe (since the structs are POD and
must remain so). To avoid unwanted dependencies creeping in in the future,
the moved files are isolated in their own target within
//device/sensors/public/cpp, with a clear explanation in the BUILD.gn file
of the constraints on this target.

BUG= 612322 
TBR=jam

Review-Url: https://codereview.chromium.org/2415083002
Cr-Commit-Position: refs/heads/master@{#458372}

[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/public/test/layouttest_support.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/BUILD.gn
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/device_sensors/device_motion_event_pump.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/device_sensors/device_motion_event_pump.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/device_sensors/device_motion_event_pump_unittest.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/device_sensors/device_orientation_event_pump.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/device_sensors/device_orientation_event_pump.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/renderer_blink_platform_impl.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/renderer/renderer_blink_platform_impl.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/shell/BUILD.gn
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/shell/renderer/layout_test/blink_test_runner.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/shell/renderer/layout_test/blink_test_runner.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/shell/test_runner/BUILD.gn
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/shell/test_runner/DEPS
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/shell/test_runner/test_runner.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/shell/test_runner/test_runner_for_specific_view.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/shell/test_runner/web_test_delegate.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/test/BUILD.gn
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/test/DEPS
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/content/test/layouttest_support.cc
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/BUILD.gn
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/generic_sensor/BUILD.gn
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/sensors/BUILD.gn
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/sensors/public/cpp/BUILD.gn
[delete] https://crrev.com/3a3ff3e332e4667ca5424370e3d7823aebbd82db/device/sensors/public/cpp/DEPS
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/sensors/public/cpp/device_motion_hardware_buffer.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/sensors/public/cpp/device_orientation_hardware_buffer.h
[add] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/sensors/public/cpp/motion_data.cc
[add] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/sensors/public/cpp/motion_data.h
[add] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/sensors/public/cpp/orientation_data.cc
[add] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/device/sensors/public/cpp/orientation_data.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/BUILD.gn
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DEPS
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.cpp
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DeviceMotionDispatcher.cpp
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DeviceMotionDispatcher.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationDispatcher.cpp
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationDispatcher.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/Source/platform/BUILD.gn
[delete] https://crrev.com/3a3ff3e332e4667ca5424370e3d7823aebbd82db/third_party/WebKit/Source/platform/exported/WebDeviceMotionData.cpp
[delete] https://crrev.com/3a3ff3e332e4667ca5424370e3d7823aebbd82db/third_party/WebKit/Source/platform/exported/WebDeviceOrientationData.cpp
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/public/BUILD.gn
[delete] https://crrev.com/3a3ff3e332e4667ca5424370e3d7823aebbd82db/third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionData.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionListener.h
[delete] https://crrev.com/3a3ff3e332e4667ca5424370e3d7823aebbd82db/third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h
[modify] https://crrev.com/241fad6fdac74b820fa21e29652bbae49239840e/third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationListener.h

Project Member

Comment 27 by bugdroid1@chromium.org, Mar 23 2017

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

commit 188eafdbbbb5bdc32823fb73944abccd2bbda5ed
Author: blundell <blundell@chromium.org>
Date: Thu Mar 23 11:19:11 2017

Convert device sensors structs from Blink to Chromium naming

Followup to https://codereview.chromium.org/2415083002/ that converts
the just-moved structs from myCoolNamingStyle to my_cool_naming_style.

BUG= 612322 

Review-Url: https://codereview.chromium.org/2763333002
Cr-Commit-Position: refs/heads/master@{#459045}

[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/content/browser/device_sensors/device_sensor_browsertest.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/content/renderer/device_sensors/device_motion_event_pump.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/content/renderer/device_sensors/device_motion_event_pump_unittest.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/content/renderer/device_sensors/device_orientation_event_pump.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/content/shell/test_runner/test_runner.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/data_fetcher_shared_memory_chromeos.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/data_fetcher_shared_memory_default.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/data_fetcher_shared_memory_mac.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/data_fetcher_shared_memory_win.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/public/cpp/motion_data.h
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/public/cpp/orientation_data.h
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/sensor_manager_android.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/sensor_manager_android_unittest.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/sensor_manager_chromeos.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/device/sensors/sensor_manager_chromeos_unittest.cc
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.cpp
[modify] https://crrev.com/188eafdbbbb5bdc32823fb73944abccd2bbda5ed/third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp

Cc: juncai@chromium.org
Just a note that juncai@ and I are working on a design doc for replacing //device/sensors with //device/generic_sensors as the backend for //third_party/WebKit/Source/modules/device_light and device_orientation so that we only have a single implementation of cross-platform support for reading these sensor values from the hardware.
Cc: reillyg@chromium.org
Hi Reilly,

Thanks for the heads-up! Do you have a design doc or any pointers to the kinds of implementation changes you're envisioning? It's not clear to me whether it would be useful to keep going with servicification of //device/sensors given your comment, or whether that would be largely wasted work.
The design doc is in progress. The high level goal is:

1) Replace usage of //device/sensors/public with //device/generic_sensor/public in //content/renderer.
2) Remove the //content/renderer layer ("Onion Soup") and use the //device/generic_sensor Mojo interface directly from //third_party/WebKit/Source/modules/device_light and device_orientation.

These may happen in one step or as two separate patches. As such a patch to do the second step but continue to use the //device/sensors Mojo interface may be useful.

I think the work done so far to separate out //device/sensors from //content has been very useful in preparing for this change but you're right that further work to servicify //device/senors is likely wasted effort.
This is very informative, thanks. To make sure I'm understanding correctly, it sounds like the existing //device/sensors interfaces AND impl are going to be basically subsumed by their //device/generic_sensor counterparts and then just deleted?
That is correct.
Project Member

Comment 33 by bugdroid1@chromium.org, Apr 24 2017

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

commit 5539439c9241c6775c78d55040faea200b84b1e7
Author: ke.he <ke.he@intel.com>
Date: Mon Apr 24 03:10:01 2017

Remove the blink dependency in device unittest.

After those device sensors client files are moved from Blink to
device sensors client lib, device unittest shouldn't depend on blink any more.

BUG =  612322 

Review-Url: https://codereview.chromium.org/2830293002
Cr-Commit-Position: refs/heads/master@{#466584}

[modify] https://crrev.com/5539439c9241c6775c78d55040faea200b84b1e7/device/BUILD.gn

Cc: alexande...@intel.com mikhail....@intel.com
Blockedon: 718457
Blockedon: 718459
Blockedon: 718460
Blockedon: -718459
Blockedon: 721427

Comment 40 by ke...@intel.com, May 19 2017

Status: Available (was: Started)

Comment 41 by ke...@intel.com, May 19 2017

Cc: -reillyg@chromium.org
Owner: reillyg@chromium.org
Status: Started (was: Available)
Reilly, I think that this bug is obsolete now, right? i.e., the plan is to eliminate //device/device_sensors entirely.

I marked you as the owner of the Blink Onion Soup-ing of //content/renderer/device_sensors, https://docs.google.com/spreadsheets/d/1VIINt17Dg2cJjPpoJ_HY3HI0uLpidql-1u8pBJtpbGk/edit#gid=1603373208, but I think that that project is actually obsolete IIUC.
The Blink Onion Soup part of the project still needs to be done. modules/device_orientation will be rewritten on top of modules/sensor.
Blockedon: 733707
Summary: Eliminate //device/sensors (was: Content Modularization Project: Device Sensors)
Retitling based on c#32 above.
Components: Internals>Services>Device
Labels: Type-Task
Migrating S13N meta bugs to Type=Task, so that they can be distinguished from technical work.
Components: Internals>Services
Owner: oksamyt@chromium.org
Owner: reillyg@chromium.org
I believe the //device/sensors directory was already removed.
Status: Fixed (was: Started)
Yes.

Sign in to add a comment