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

Issue 2885203004: Refactor content/renderer/device_sensors to use device/generic_sensor instead of device/sensors (Closed)

Created:
3 years, 7 months ago by juncai
Modified:
3 years, 7 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, agrieve+watch_chromium.org, jam, abarth-chromium, dglazkov+blink, darin-cc_chromium.org, wanming.lin, blink-reviews, einbinder+watch-test-runner_chromium.org, blink-reviews-api_chromium.org, mlamouri+watch-content_chromium.org, Peter Beverloo, timvolodine, mlamouri+watch-sensors_chromium.org, haraken, jochen+watch_chromium.org, mlamouri+watch-test-runner_chromium.org, shalamov, mlamouri+watch-blink_chromium.org, riju_, Aaron Boodman, mac-reviews_chromium.org, darin (slow to review), Mikhail
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor content/renderer/device_sensors to use device/generic_sensor instead of device/sensors //device/generic_sensors already has all the sensors that can be used to implement the DeviceOrientation event: https://w3c.github.io/deviceorientation/spec-source-orientation.html Currently, //content/renderer/device_sensors uses sensors from //device/sensors as its backend, and this CL refactors //content/renderer/device_sensors to use sensors from //device/generic_sensor as the backend and removes //device/sensors. BUG=721427

Patch Set 1 : refactor content/renderer/device_sensors to use device/generic_sensor instead of device/sensors #

Patch Set 2 : updated content/renderer/BUILD.gn #

Patch Set 3 : updated comments #

Patch Set 4 : updated tests #

Patch Set 5 : updated content/renderer/BUILD.gn #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+1325 lines, -5997 lines) Patch
M content/app/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M content/app/android/library_loader_hooks.cc View 2 chunks +0 lines, -4 lines 0 comments Download
D content/browser/device_sensors/DEPS View 1 chunk +0 lines, -3 lines 0 comments Download
D content/browser/device_sensors/OWNERS View 1 chunk +0 lines, -4 lines 0 comments Download
D content/browser/device_sensors/device_sensor_browsertest.cc View 1 chunk +0 lines, -398 lines 0 comments Download
M content/public/android/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M content/public/test/layouttest_support.h View 3 chunks +6 lines, -9 lines 0 comments Download
M content/renderer/BUILD.gn View 1 2 3 4 2 chunks +5 lines, -2 lines 0 comments Download
M content/renderer/DEPS View 1 chunk +2 lines, -1 line 0 comments Download
M content/renderer/device_sensors/device_motion_event_pump.h View 1 chunk +11 lines, -14 lines 0 comments Download
M content/renderer/device_sensors/device_motion_event_pump.cc View 1 chunk +87 lines, -14 lines 0 comments Download
M content/renderer/device_sensors/device_motion_event_pump_unittest.cc View 1 2 3 8 chunks +145 lines, -57 lines 0 comments Download
A content/renderer/device_sensors/device_orientation_absolute_event_pump.h View 1 chunk +45 lines, -0 lines 0 comments Download
A content/renderer/device_sensors/device_orientation_absolute_event_pump.cc View 1 chunk +69 lines, -0 lines 2 comments Download
M content/renderer/device_sensors/device_orientation_event_pump.h View 2 chunks +15 lines, -30 lines 0 comments Download
M content/renderer/device_sensors/device_orientation_event_pump.cc View 1 chunk +92 lines, -50 lines 2 comments Download
M content/renderer/device_sensors/device_orientation_event_pump_unittest.cc View 1 2 3 8 chunks +198 lines, -73 lines 0 comments Download
A content/renderer/device_sensors/device_orientation_util.h View 1 chunk +52 lines, -0 lines 0 comments Download
A content/renderer/device_sensors/device_orientation_util.cc View 1 2 1 chunk +254 lines, -0 lines 0 comments Download
M content/renderer/device_sensors/device_sensor_event_pump.h View 1 chunk +213 lines, -72 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.h View 3 chunks +5 lines, -4 lines 0 comments Download
M content/renderer/renderer_blink_platform_impl.cc View 4 chunks +6 lines, -5 lines 0 comments Download
M content/shell/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M content/shell/android/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.h View 2 chunks +5 lines, -4 lines 0 comments Download
M content/shell/renderer/layout_test/blink_test_runner.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M content/shell/test_runner/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
M content/shell/test_runner/DEPS View 1 chunk +0 lines, -1 line 0 comments Download
M content/shell/test_runner/test_runner.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M content/shell/test_runner/test_runner_for_specific_view.cc View 1 chunk +0 lines, -2 lines 0 comments Download
M content/shell/test_runner/web_test_delegate.h View 3 chunks +4 lines, -7 lines 0 comments Download
M content/test/BUILD.gn View 4 chunks +2 lines, -6 lines 0 comments Download
M content/test/DEPS View 1 chunk +2 lines, -1 line 0 comments Download
M content/test/layouttest_support.cc View 3 chunks +4 lines, -6 lines 0 comments Download
M device/BUILD.gn View 3 chunks +0 lines, -7 lines 0 comments Download
M device/generic_sensor/BUILD.gn View 1 chunk +1 line, -4 lines 0 comments Download
M device/generic_sensor/public/interfaces/BUILD.gn View 1 chunk +0 lines, -1 line 0 comments Download
D device/sensors/BUILD.gn View 1 chunk +0 lines, -108 lines 0 comments Download
D device/sensors/DEPS View 1 chunk +0 lines, -5 lines 0 comments Download
D device/sensors/OWNERS View 1 chunk +0 lines, -4 lines 0 comments Download
D device/sensors/README.md View 1 chunk +0 lines, -20 lines 0 comments Download
D device/sensors/android/device_sensor_jni_registrar.h View 1 chunk +0 lines, -20 lines 0 comments Download
D device/sensors/android/device_sensor_jni_registrar.cc View 1 chunk +0 lines, -27 lines 0 comments Download
D device/sensors/android/java/src/org/chromium/device/sensors/DeviceSensors.java View 1 chunk +0 lines, -646 lines 0 comments Download
D device/sensors/android/javatests/src/org/chromium/device/sensors/DeviceSensorsTest.java View 1 chunk +0 lines, -594 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory.h View 1 chunk +0 lines, -83 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory_android.cc View 1 chunk +0 lines, -64 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory_base.h View 1 chunk +0 lines, -103 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory_base.cc View 1 chunk +0 lines, -246 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory_base_unittest.cc View 1 chunk +0 lines, -522 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory_chromeos.cc View 1 chunk +0 lines, -66 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory_default.cc View 1 chunk +0 lines, -77 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory_mac.cc View 1 chunk +0 lines, -212 lines 0 comments Download
D device/sensors/data_fetcher_shared_memory_win.cc View 1 chunk +0 lines, -423 lines 0 comments Download
D device/sensors/device_sensor_export.h View 1 chunk +0 lines, -29 lines 0 comments Download
D device/sensors/device_sensor_host.h View 1 chunk +0 lines, -50 lines 0 comments Download
D device/sensors/device_sensor_host.cc View 1 chunk +0 lines, -75 lines 0 comments Download
D device/sensors/device_sensor_service.h View 1 chunk +0 lines, -77 lines 0 comments Download
D device/sensors/device_sensor_service.cc View 1 chunk +0 lines, -115 lines 0 comments Download
D device/sensors/device_sensors_consts.h View 1 chunk +0 lines, -32 lines 0 comments Download
D device/sensors/public/cpp/BUILD.gn View 1 chunk +0 lines, -43 lines 0 comments Download
D device/sensors/public/cpp/device_motion_hardware_buffer.h View 1 chunk +0 lines, -17 lines 0 comments Download
D device/sensors/public/cpp/device_orientation_hardware_buffer.h View 1 chunk +0 lines, -18 lines 0 comments Download
D device/sensors/public/cpp/motion_data.h View 1 chunk +0 lines, -54 lines 0 comments Download
D device/sensors/public/cpp/motion_data.cc View 1 chunk +0 lines, -21 lines 0 comments Download
D device/sensors/public/cpp/orientation_data.h View 1 chunk +0 lines, -38 lines 0 comments Download
D device/sensors/public/cpp/orientation_data.cc View 1 chunk +0 lines, -19 lines 0 comments Download
D device/sensors/public/interfaces/BUILD.gn View 1 chunk +0 lines, -12 lines 0 comments Download
D device/sensors/public/interfaces/OWNERS View 1 chunk +0 lines, -4 lines 0 comments Download
D device/sensors/public/interfaces/motion.mojom View 1 chunk +0 lines, -10 lines 0 comments Download
D device/sensors/public/interfaces/orientation.mojom View 1 chunk +0 lines, -15 lines 0 comments Download
D device/sensors/sensor_manager_android.h View 1 chunk +0 lines, -147 lines 0 comments Download
D device/sensors/sensor_manager_android.cc View 1 chunk +0 lines, -397 lines 0 comments Download
D device/sensors/sensor_manager_android_unittest.cc View 1 chunk +0 lines, -178 lines 0 comments Download
D device/sensors/sensor_manager_chromeos.h View 1 chunk +0 lines, -69 lines 0 comments Download
D device/sensors/sensor_manager_chromeos.cc View 1 chunk +0 lines, -166 lines 0 comments Download
D device/sensors/sensor_manager_chromeos_unittest.cc View 1 chunk +0 lines, -229 lines 0 comments Download
M services/device/BUILD.gn View 1 chunk +0 lines, -2 lines 0 comments Download
M services/device/device_service.h View 2 chunks +0 lines, -14 lines 0 comments Download
M services/device/device_service.cc View 3 chunks +0 lines, -61 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/BUILD.gn View 1 chunk +0 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DEPS View 1 chunk +0 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.h View 2 chunks +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DeviceMotionData.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DeviceMotionDispatcher.h View 2 chunks +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DeviceMotionDispatcher.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.h View 2 chunks +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DeviceOrientationData.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DeviceOrientationDispatcher.h View 2 chunks +2 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/device_orientation/DeviceOrientationDispatcher.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
A + third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionData.h View 2 chunks +42 lines, -35 lines 2 comments Download
M third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionListener.h View 1 chunk +2 lines, -5 lines 0 comments Download
A + third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationData.h View 2 chunks +32 lines, -13 lines 0 comments Download
M third_party/WebKit/public/platform/modules/device_orientation/WebDeviceOrientationListener.h View 1 chunk +2 lines, -5 lines 0 comments Download

Messages

Total messages: 30 (25 generated)
juncai
Please take a look.
3 years, 7 months ago (2017-05-19 02:41:50 UTC) #24
Reilly Grant (use Gerrit)
Can you break this up into a smaller patch by refactoring DeviceMotionEvent and DeviceOrientationEvent separately ...
3 years, 7 months ago (2017-05-19 20:04:09 UTC) #27
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2885203004/diff/80001/content/renderer/device_sensors/device_orientation_absolute_event_pump.cc File content/renderer/device_sensors/device_orientation_absolute_event_pump.cc (right): https://codereview.chromium.org/2885203004/diff/80001/content/renderer/device_sensors/device_orientation_absolute_event_pump.cc#newcode22 content/renderer/device_sensors/device_orientation_absolute_event_pump.cc:22: GetSensor(device::mojom::SensorType::ABSOLUTE_ORIENTATION, sensors_[0].get()); Can you combine these two lines into ...
3 years, 7 months ago (2017-05-19 20:20:11 UTC) #28
juncai
On 2017/05/19 20:04:09, Reilly Grant wrote: > Can you break this up into a smaller ...
3 years, 7 months ago (2017-05-20 00:54:47 UTC) #29
juncai
3 years, 7 months ago (2017-05-20 00:55:02 UTC) #30
https://codereview.chromium.org/2885203004/diff/80001/content/renderer/device...
File content/renderer/device_sensors/device_orientation_absolute_event_pump.cc
(right):

https://codereview.chromium.org/2885203004/diff/80001/content/renderer/device...
content/renderer/device_sensors/device_orientation_absolute_event_pump.cc:22:
GetSensor(device::mojom::SensorType::ABSOLUTE_ORIENTATION, sensors_[0].get());
On 2017/05/19 20:20:10, Reilly Grant wrote:
> Can you combine these two lines into a single call?

Fixed it in a new CL:
https://codereview.chromium.org/2896583005/

Done.

https://codereview.chromium.org/2885203004/diff/80001/content/renderer/device...
File content/renderer/device_sensors/device_orientation_event_pump.cc (right):

https://codereview.chromium.org/2885203004/diff/80001/content/renderer/device...
content/renderer/device_sensors/device_orientation_event_pump.cc:34:
GetSensor(device::mojom::SensorType::MAGNETOMETER, sensors_[3].get());
On 2017/05/19 20:20:11, Reilly Grant wrote:
> We don't want to activate all four of these sensors at once, just 0, 1, or 2
and
> 3 so we should wait to find out if the preferred sensor type is available
before
> activating the fallback.

Will fix it in the device orientation refactoring CL.

https://codereview.chromium.org/2885203004/diff/80001/third_party/WebKit/publ...
File
third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionData.h
(right):

https://codereview.chromium.org/2885203004/diff/80001/third_party/WebKit/publ...
third_party/WebKit/public/platform/modules/device_orientation/WebDeviceMotionData.h:47:
memset(this, 0, sizeof(*this));
On 2017/05/19 20:20:11, Reilly Grant wrote:
> This structure is no longer used for a shared buffer. The constructor should
use
> conventional means to initialize the bool fields to false.

Fixed it in a new CL:
https://codereview.chromium.org/2896583005/

Done.

Powered by Google App Engine
This is Rietveld 408576698