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

Issue 686707 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Email to this user bounced
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocked on:
issue 686706
issue 686709
issue 687125

Blocking:
issue 612322



Sign in to add a comment

Move //device/sensors impl to be part of the internal implementation of the Device Service

Project Member Reported by blundell@chromium.org, Jan 30 2017

Issue description

Once all production code accesses the device sensors code only via Mojo interfaces exported by the Device Service, the impl of those interfaces should be made part of the internal implementation of the Device Service. To that end, //device/sensors should be moved to //service/device/sensors and made visible in GN only to //services/device.

Note that browsertests in //content might still access this code directly. It is lower-priority to eliminate that dependency (e.g., by porting the browsertests to service tests of the Device Service).
 
Summary: Move //device/sensors impl to be part of the internal implementation of the Device Service (was: Make //device/sensors impl part of the internal implementation of the Device Service)
Note that this includes moving the Java code and registering its JNI in the Device Service rather than in //content/app.
Blockedon: 687125
Blockedon: 686709

Comment 5 Deleted

Comment 6 by ke...@intel.com, Feb 21 2017

Cc: -ke...@intel.com blundell@chromium.org
Owner: ke...@intel.com

Comment 7 by ke...@intel.com, Feb 21 2017

In file "device_sensor_browsertest.cc", it depends below files which are in //device/sensors/ (not in //device/sensors/public/)
 #include "device/sensors/data_fetcher_shared_memory.h"
 #include "device/sensors/device_sensor_service.h"

We have to replace this browsertest by a layouttest? similar as vibration_browsertest (686692)
Status: Assigned (was: Available)
Ke He, thanks for the analysis here! Yes, those direct dependencies have to go as well, or else the browsertest needs to be ported to a service test that lives in the Device Service itself (i.e., the usage of the renderer would be replaced by a test "device sensor client" service that the test can connect to and drive. Can you file a separate bug for that and block  crbug.com/612322  on it? We can do the work described in this bug first, and have an additional GN visibility for content_browsertests with a TODO to remove it.

Comment 9 by ke...@intel.com, Feb 23 2017

Colin, I found your CL "Move Device Sensors client files from Blink to //device/sensors client lib"(Issue 2415083002) is still in pending.

I guess we need to suspend this task until your CL get landed? Otherwise it will introduce dependencies from //services/device on //blink.
Ke He, you are correct. This is issue  crbug.com/686709 , which is blocking this one. However, as that issue notes, the approach I took in that CL won't work due to Blink dependency rules. Instead, we'll have to define those structs/types/etc in mojom to share them between the Blink client and the Device Service.

Comment 11 by ke...@intel.com, Feb 24 2017

Hi, Colin, my thoughts on 686709 mentioned above:

Option 1): there is only one line code "memset(this, 0, sizeof(*this));" in file WebDeviceMotionData.cpp in blink, So how about to delete this file and move the "memset(..)" into file "WebDeviceMotionData.h" as inline? then the dependency of ""//third_party/WebKit/public:blink" can be removed. //services/device/ will only depend on "//third_party/WebKit/public:blink_headers" which is allowed I guess?

Option 2): if depending on blink_headers is not allowed, I'll add definitions of struct WebDeviceMotionData in mojom, and remove the original definitions in blink:: namespace. Then replace all the references by mojo::WebDeviceMotionData. But I found that the blink::WebDeviceMotionData uses "pragma pack", it occupies smaller memory, while I didn't find any "pragma pack" grammar in mojo. In this way the struct occupies larger memory, So it leads to we transfer a larger mojo::sharedBuffer from browser to render. Do you think it's ok?

Thanks!
Thanks for this investigation! We don't want a dependency even on Blink headers in the Device Service, as it would be a dependency inversion for Device Service to depend on one of its clients. That leaves option (2).

However, the question that you raise there is important. I'm going to chew over the best way to get feedback on that question; stay tuned there.

Comment 13 by ke...@intel.com, Feb 27 2017

Hi, Colin, Thank you. Please let me know if something we can continue.

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

Status: WontFix (was: Assigned)
As Reilly is planing to merge sensor into generic_sensor, so we set this as WontFix.

The obsolete CL for this: https://codereview.chromium.org/2819273006/
Components: Internals>Services>Device

Sign in to add a comment