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

Issue 12771008: Implement java-side browser sensor polling for device motion and device orientation DOM events. (Closed)

Created:
7 years, 9 months ago by timvolodine
Modified:
7 years, 8 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Implement the java-side browser sensor polling for device motion and device orientation DOM events. BUG=135804 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=190639

Patch Set 1 #

Total comments: 50

Patch Set 2 : taking into account the comments #

Total comments: 24

Patch Set 3 : fixing diff and comments #

Total comments: 85

Patch Set 4 : fixed comments #

Total comments: 54

Patch Set 5 : fixed comments #

Total comments: 16

Patch Set 6 : yet another patch #

Patch Set 7 : added tests and mocks #

Total comments: 37

Patch Set 8 : fixed comments and trybots #

Total comments: 16

Patch Set 9 : fixed Marcus's comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+613 lines, -348 lines) Patch
M content/browser/device_orientation/data_fetcher_impl_android.h View 1 2 2 chunks +10 lines, -2 lines 0 comments Download
M content/browser/device_orientation/data_fetcher_impl_android.cc View 1 2 3 4 5 6 7 8 5 chunks +33 lines, -11 lines 0 comments Download
M content/browser/device_orientation/device_data.h View 1 2 3 1 chunk +5 lines, -3 lines 0 comments Download
M content/content_jni.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
A + content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java View 1 2 3 4 5 6 7 8 8 chunks +265 lines, -62 lines 2 comments Download
D content/public/android/java/src/org/chromium/content/browser/DeviceOrientation.java View 1 1 chunk +0 lines, -269 lines 0 comments Download
A content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java View 1 2 3 4 5 6 7 8 1 chunk +299 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
timvolodine1
7 years, 9 months ago (2013-03-11 17:04:50 UTC) #1
Peter Beverloo
Some initial comments. https://codereview.chromium.org/12771008/diff/1/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc (right): https://codereview.chromium.org/12771008/diff/1/content/browser/device_orientation/data_fetcher_impl_android.cc#newcode10 content/browser/device_orientation/data_fetcher_impl_android.cc:10: #include "jni/DeviceMotionAndOrientation_jni.h" What's happening to the ...
7 years, 9 months ago (2013-03-11 17:57:25 UTC) #2
Miguel Garcia
Some comments from my side, very inline with Peter's https://codereview.chromium.org/12771008/diff/1/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc (right): https://codereview.chromium.org/12771008/diff/1/content/browser/device_orientation/data_fetcher_impl_android.cc#newcode10 content/browser/device_orientation/data_fetcher_impl_android.cc:10: ...
7 years, 9 months ago (2013-03-11 18:25:50 UTC) #3
timvolodine1
thanks for the comments, uploaded a new patch taking them into account https://codereview.chromium.org/12771008/diff/1/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc ...
7 years, 9 months ago (2013-03-12 11:18:06 UTC) #4
timvolodine1
https://codereview.chromium.org/12771008/diff/9001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java File content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java (right): https://codereview.chromium.org/12771008/diff/9001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java#newcode1 content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
7 years, 9 months ago (2013-03-12 11:22:40 UTC) #5
Peter Beverloo
https://codereview.chromium.org/12771008/diff/9001/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc (right): https://codereview.chromium.org/12771008/diff/9001/content/browser/device_orientation/data_fetcher_impl_android.cc#newcode46 content/browser/device_orientation/data_fetcher_impl_android.cc:46: Stop(DeviceData::kTypeOrientation); nit: add a TODO to cover that this ...
7 years, 9 months ago (2013-03-12 11:26:39 UTC) #6
Miguel Garcia
https://codereview.chromium.org/12771008/diff/9001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java File content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java (right): https://codereview.chromium.org/12771008/diff/9001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java#newcode1 content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
7 years, 9 months ago (2013-03-12 11:40:51 UTC) #7
timvolodine
incorporated new comments and uploaded a new patch with the correct diff for the java ...
7 years, 9 months ago (2013-03-12 16:12:46 UTC) #8
Miguel Garcia
https://codereview.chromium.org/12771008/diff/24001/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc (right): https://codereview.chromium.org/12771008/diff/24001/content/browser/device_orientation/data_fetcher_impl_android.cc#newcode36 content/browser/device_orientation/data_fetcher_impl_android.cc:36: DataFetcher* DataFetcherImplAndroid::Create() { don't you want to at least ...
7 years, 9 months ago (2013-03-12 17:00:26 UTC) #9
Peter Beverloo
https://codereview.chromium.org/12771008/diff/24001/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc (right): https://codereview.chromium.org/12771008/diff/24001/content/browser/device_orientation/data_fetcher_impl_android.cc#newcode34 content/browser/device_orientation/data_fetcher_impl_android.cc:34: // TODO(timvolodine): figure out how to modify this method ...
7 years, 9 months ago (2013-03-12 17:11:22 UTC) #10
timvolodine
fixed comments, uploaded new patch https://codereview.chromium.org/12771008/diff/24001/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc (right): https://codereview.chromium.org/12771008/diff/24001/content/browser/device_orientation/data_fetcher_impl_android.cc#newcode34 content/browser/device_orientation/data_fetcher_impl_android.cc:34: // TODO(timvolodine): figure out ...
7 years, 9 months ago (2013-03-13 12:32:24 UTC) #11
Miguel Garcia
Some comments on the java side, this is starting to look good https://codereview.chromium.org/12771008/diff/35001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java File content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java ...
7 years, 9 months ago (2013-03-13 13:37:09 UTC) #12
Peter Beverloo
https://codereview.chromium.org/12771008/diff/24001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java File content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java (right): https://codereview.chromium.org/12771008/diff/24001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java#newcode213 content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java:213: // Unexpected On 2013/03/13 12:32:24, timvolodine wrote: > It ...
7 years, 9 months ago (2013-03-13 14:02:47 UTC) #13
timvolodine
uploaded new patch https://codereview.chromium.org/12771008/diff/24001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java File content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java (right): https://codereview.chromium.org/12771008/diff/24001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java#newcode299 content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java:299: Sensor defaultSensor = sensorManager.getDefaultSensor(type); On 2013/03/13 ...
7 years, 9 months ago (2013-03-13 15:29:49 UTC) #14
Miguel Garcia
I think that all the set operations can be simplified significantly, let me know what ...
7 years, 9 months ago (2013-03-13 16:04:29 UTC) #15
Peter Beverloo
This indeed is a lot better, thank you. A few more comments -- mostly nits!, ...
7 years, 9 months ago (2013-03-13 16:18:56 UTC) #16
timvolodine
https://codereview.chromium.org/12771008/diff/35001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java File content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java (right): https://codereview.chromium.org/12771008/diff/35001/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java#newcode114 content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java:114: success = registerForSensors(sensorsToActivate, rateInMilliseconds, false); On 2013/03/13 16:04:29, Miguel ...
7 years, 9 months ago (2013-03-13 17:53:01 UTC) #17
timvolodine
added tests patch should be complete now
7 years, 9 months ago (2013-03-18 15:18:49 UTC) #18
Miguel Garcia
Some extra comments on the test https://codereview.chromium.org/12771008/diff/40002/content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java File content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java (right): https://codereview.chromium.org/12771008/diff/40002/content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java#newcode32 content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java:32: */ Do you ...
7 years, 9 months ago (2013-03-19 15:12:00 UTC) #19
bulach
looking forward to see this landing! a few comments and nits below, I hope it'll ...
7 years, 9 months ago (2013-03-19 15:22:36 UTC) #20
timvolodine
thanks for comments, fixed most of them replies below https://codereview.chromium.org/12771008/diff/40002/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc (right): https://codereview.chromium.org/12771008/diff/40002/content/browser/device_orientation/data_fetcher_impl_android.cc#newcode101 content/browser/device_orientation/data_fetcher_impl_android.cc:101: ...
7 years, 9 months ago (2013-03-19 16:50:08 UTC) #21
Miguel Garcia
https://codereview.chromium.org/12771008/diff/40002/content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java File content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java (right): https://codereview.chromium.org/12771008/diff/40002/content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java#newcode32 content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java:32: */ It feels that a plain AndroidTestCase would do. ...
7 years, 9 months ago (2013-03-19 17:06:13 UTC) #22
timvolodine
https://codereview.chromium.org/12771008/diff/40002/content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java File content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java (right): https://codereview.chromium.org/12771008/diff/40002/content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java#newcode32 content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java:32: */ ok, that works also -- done. On 2013/03/19 ...
7 years, 9 months ago (2013-03-19 17:31:55 UTC) #23
Miguel Garcia
lgtm https://codereview.chromium.org/12771008/diff/40002/content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java File content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java (right): https://codereview.chromium.org/12771008/diff/40002/content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java#newcode276 content/public/android/javatests/src/org/chromium/content/browser/DeviceMotionAndOrientationTest.java:276: static class MockSensorManager implements DeviceMotionAndOrientation.SensorManagerProxy { Alright, I ...
7 years, 9 months ago (2013-03-19 17:57:22 UTC) #24
Miguel Garcia
lgtm Thanks for putting up with all the comments!
7 years, 9 months ago (2013-03-19 17:57:46 UTC) #25
bulach
lgtm, just some nits and one question on the mNativePtr below, feel free to go ...
7 years, 9 months ago (2013-03-19 18:51:06 UTC) #26
timvolodine
https://codereview.chromium.org/12771008/diff/52019/content/browser/device_orientation/data_fetcher_impl_android.cc File content/browser/device_orientation/data_fetcher_impl_android.cc (right): https://codereview.chromium.org/12771008/diff/52019/content/browser/device_orientation/data_fetcher_impl_android.cc#newcode98 content/browser/device_orientation/data_fetcher_impl_android.cc:98: bool DataFetcherImplAndroid::Start(DeviceData::Type event_type, On 2013/03/19 18:51:06, bulach wrote: > ...
7 years, 9 months ago (2013-03-19 19:35:04 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/12771008/21002
7 years, 9 months ago (2013-03-20 11:28:23 UTC) #28
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=109272
7 years, 9 months ago (2013-03-20 12:28:33 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/12771008/21002
7 years, 9 months ago (2013-03-21 16:53:10 UTC) #30
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 9 months ago (2013-03-21 18:52:35 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/12771008/21002
7 years, 9 months ago (2013-03-25 19:42:46 UTC) #32
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=127317
7 years, 9 months ago (2013-03-26 01:21:03 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/timvolodine@chromium.org/12771008/21002
7 years, 9 months ago (2013-03-26 10:57:15 UTC) #34
commit-bot: I haz the power
Change committed as 190639
7 years, 9 months ago (2013-03-26 11:08:38 UTC) #35
joth
drive by FYI, in case you happen to still be working on this file... https://chromiumcodereview.appspot.com/12771008/diff/21002/content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java ...
7 years, 8 months ago (2013-04-17 21:02:26 UTC) #36
timvolodine
7 years, 8 months ago (2013-04-18 13:44:12 UTC) #37
Message was sent while issue was closed.
thanks!
new patch uploaded at:
https://codereview.chromium.org/14352008/

https://chromiumcodereview.appspot.com/12771008/diff/21002/content/public/and...
File
content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java
(right):

https://chromiumcodereview.appspot.com/12771008/diff/21002/content/public/and...
content/public/android/java/src/org/chromium/content/browser/DeviceMotionAndOrientation.java:360:
private Handler getHandler() {
On 2013/04/17 21:02:26, joth wrote:
> this whole function could be
> private Handler getHandler() {
>    synchronized (mHandlerLock) {
>       if (mHandler == null) {
>           HandlerThead thread = new HandlerThread();
>           thread.start();
>           mHandler = new Handler(thread.getLooper());  // blocks on thread
start
>        }
>        return mHandler;
>    }
> }
> 
> // and then delete setHandler()

Done.

Powered by Google App Engine
This is Rietveld 408576698