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

Issue 2416123003: [Device Sensors] Move Mojo communication to UI thread on Android (Closed)

Created:
4 years, 2 months ago by blundell
Modified:
4 years, 1 month ago
CC:
chromium-reviews, creis+watch_chromium.org, riju_, nasko+codewatch_chromium.org, jam, timvolodine, darin-cc_chromium.org, mlamouri+watch-sensors_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[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 Committed: https://crrev.com/4489ef7781fd694d199e2c5a407f0614317de2d7 Cr-Commit-Position: refs/heads/master@{#432455}

Patch Set 1 #

Patch Set 2 : git cl format #

Patch Set 3 : Update browsertest #

Patch Set 4 : Fix browsertest #

Total comments: 4

Patch Set 5 : Rebase #

Patch Set 6 : Response to review #

Total comments: 4

Patch Set 7 : Rebase #

Patch Set 8 : Response to review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -165 lines) Patch
M content/browser/device_sensors/device_sensor_browsertest.cc View 1 2 3 4 5 6 7 15 chunks +101 lines, -47 lines 0 comments Download
M content/browser/device_sensors/device_sensor_host.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/device_sensors/sensor_manager_android.h View 2 chunks +1 line, -15 lines 0 comments Download
M content/browser/device_sensors/sensor_manager_android.cc View 1 2 3 4 5 13 chunks +7 lines, -102 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 1 chunk +13 lines, -1 line 0 comments Download

Dependent Patchsets:

Messages

Total messages: 35 (20 generated)
blundell
4 years, 1 month ago (2016-10-25 22:05:50 UTC) #11
blundell
On 2016/10/25 22:05:50, blundell wrote: ping :)
4 years, 1 month ago (2016-10-27 23:38:52 UTC) #12
timvolodine
just what I had in mind, thanks! https://codereview.chromium.org/2416123003/diff/60001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2416123003/diff/60001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode375 content/browser/device_sensors/device_sensor_browsertest.cc:375: base::RunLoop motion_started_runloop; ...
4 years, 1 month ago (2016-10-31 15:51:45 UTC) #13
blundell
Thanks for the review! https://codereview.chromium.org/2416123003/diff/60001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2416123003/diff/60001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode375 content/browser/device_sensors/device_sensor_browsertest.cc:375: base::RunLoop motion_started_runloop; On 2016/10/31 15:51:44, ...
4 years, 1 month ago (2016-11-09 15:07:43 UTC) #18
timvolodine
lgtm with 2 comments. thanks a lot :) https://codereview.chromium.org/2416123003/diff/100001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2416123003/diff/100001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode208 content/browser/device_sensors/device_sensor_browsertest.cc:208: // ...
4 years, 1 month ago (2016-11-10 16:18:21 UTC) #19
blundell
Thanks, Tim! https://codereview.chromium.org/2416123003/diff/100001/content/browser/device_sensors/device_sensor_browsertest.cc File content/browser/device_sensors/device_sensor_browsertest.cc (right): https://codereview.chromium.org/2416123003/diff/100001/content/browser/device_sensors/device_sensor_browsertest.cc#newcode208 content/browser/device_sensors/device_sensor_browsertest.cc:208: // Initialize the RunLoops now that the ...
4 years, 1 month ago (2016-11-15 09:04:44 UTC) #20
blundell
Oh right, we could just have the runloops live as pointers inside the fake data ...
4 years, 1 month ago (2016-11-15 09:07:06 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2416123003/140001
4 years, 1 month ago (2016-11-15 09:07:41 UTC) #24
blundell
I'll look at doing that simplification in a followup patch.
4 years, 1 month ago (2016-11-15 09:09:43 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/304231)
4 years, 1 month ago (2016-11-15 09:16:11 UTC) #27
blundell
Ben, can you review //content/browser/render_process_host_impl.cc as jam is out? Thanks!
4 years, 1 month ago (2016-11-15 09:17:59 UTC) #29
Ben Goodger (Google)
lgtm
4 years, 1 month ago (2016-11-16 01:14:49 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2416123003/140001
4 years, 1 month ago (2016-11-16 10:04:38 UTC) #32
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 1 month ago (2016-11-16 11:00:36 UTC) #33
commit-bot: I haz the power
4 years, 1 month ago (2016-11-16 11:02:53 UTC) #35
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/4489ef7781fd694d199e2c5a407f0614317de2d7
Cr-Commit-Position: refs/heads/master@{#432455}

Powered by Google App Engine
This is Rietveld 408576698