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

Issue 65273002: Add a mechanism to pause and resume geolocation requests. (Closed)

Created:
7 years, 1 month ago by benm (inactive)
Modified:
7 years ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Add a mechanism to pause and resume geolocation requests. Currently Android WebView is the only platform to make use of this new API. We implement this as a new API on the Browser-side GeolocationDispatcherHost. In doing so: - Refactor the current LocationProvider such that it doesn't rely on ActivityStatus, updating LocationProviderTest accordingly - Introduce ContentViewLocationTest.java that verifies the LocationProvider implementation is paused and resumed when the ContentView is hidde/shown - Introduce a AwGeolocationTest that verifies the LocationProvider implementation is paused and resumed when the new API is invoked - Introduce LocationProviderFactory and a MockLocationProvider to avoid relying on the system location provider when running tests, as it's not possible to enable mock locations on Android user builds without physical access to the device. BUG=b/11336074 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=240719

Patch Set 1 #

Patch Set 2 : Wire up onPause/onResume #

Total comments: 9

Patch Set 3 : Simplify: use existing Add/Remove LocationCallback APIs rather than introducing pause/resume #

Patch Set 4 : Don't add any new IPC. Obsoletes the Blink side patch. #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 8

Patch Set 7 : joth comments #

Total comments: 5

Patch Set 8 : Last round of comments #

Patch Set 9 : Checkpoint; still needs some work. #

Total comments: 1

Patch Set 10 : Attempt to fix threading issue in shutdown for bots #

Patch Set 11 : Fix the bots? #

Patch Set 12 : #

Patch Set 13 : Clean up java #

Patch Set 14 : #

Total comments: 1

Patch Set 15 : Introduce mock location provider to run tests on bots. #

Patch Set 16 : #

Patch Set 17 : Add ContentViewLocationTests #

Patch Set 18 : Add new test case, fix a bug :) #

Total comments: 1

Patch Set 19 : Move the mock out per mkosiba's comment #

Patch Set 20 : remove unsused CVC.isGeolocationActiveForTest API #

Total comments: 33

Patch Set 21 : Marcus/Marcin's comments #

Patch Set 22 : #

Total comments: 4

Patch Set 23 : remove posttask #

Patch Set 24 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+855 lines, -549 lines) Patch
A android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +267 lines, -0 lines 0 comments Download
android_webview/native/aw_contents.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +6 lines, -4 lines 0 comments Download
M content/browser/android/content_view_core_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +3 lines, -0 lines 0 comments Download
M content/browser/android/content_view_core_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +26 lines, -2 lines 0 comments Download
M content/browser/geolocation/geolocation_dispatcher_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +7 lines, -0 lines 0 comments Download
M content/browser/geolocation/geolocation_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +87 lines, -35 lines 0 comments Download
M content/browser/geolocation/location_api_adapter_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 4 chunks +5 lines, -4 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 4 chunks +10 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 5 chunks +9 lines, -6 lines 0 comments Download
M content/content_jni.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +1 line, -1 line 0 comments Download
D content/public/android/java/src/org/chromium/content/browser/LocationProvider.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +0 lines, -269 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/LocationProviderAdapter.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +100 lines, -0 lines 0 comments Download
content/public/android/java/src/org/chromium/content/browser/LocationProviderFactory.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 7 chunks +48 lines, -108 lines 0 comments Download
A content/public/android/javatests/src/org/chromium/content/browser/ContentViewLocationTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +173 lines, -0 lines 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/LocationProviderTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 5 chunks +3 lines, -120 lines 0 comments Download
M content/public/browser/android/content_view_core.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
A content/public/test/android/javatests/src/org/chromium/content/browser/test/util/MockLocationProvider.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 chunk +92 lines, -0 lines 0 comments Download
A content/test/data/android/device_files/geolocation.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 38 (0 generated)
benm (inactive)
Hi joth, would you be able to take a look at this? Seems like this ...
7 years, 1 month ago (2013-11-07 21:07:50 UTC) #1
joth
size of change is a bit hairy, but I can see where it's headed and ...
7 years, 1 month ago (2013-11-07 21:51:59 UTC) #2
joth
https://codereview.chromium.org/65273002/diff/30001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (right): https://codereview.chromium.org/65273002/diff/30001/content/browser/geolocation/geolocation_dispatcher_host.cc#newcode246 content/browser/geolocation/geolocation_dispatcher_host.cc:246: geolocation_provider_->RemoveLocationUpdateCallback(callback_); On 2013/11/07 21:52:00, joth wrote: > can we ...
7 years, 1 month ago (2013-11-07 21:58:15 UTC) #3
Ben Murdoch
Thanks joth! On 7 Nov 2013 21:52, <joth@chromium.org> wrote: > > size of change is ...
7 years, 1 month ago (2013-11-07 22:22:54 UTC) #4
benm (inactive)
On 7 Nov 2013 21:58, <joth@chromium.org> wrote: > > > https://codereview.chromium.org/65273002/diff/30001/content/browser/geolocation/geolocation_dispatcher_host.cc > File content/browser/geolocation/geolocation_dispatcher_host.cc (right): ...
7 years, 1 month ago (2013-11-07 22:27:51 UTC) #5
Michael van Ouwerkerk
https://codereview.chromium.org/65273002/diff/30001/content/common/geolocation_messages.h File content/common/geolocation_messages.h (right): https://codereview.chromium.org/65273002/diff/30001/content/common/geolocation_messages.h#newcode75 content/common/geolocation_messages.h:75: int, Comment what this is https://codereview.chromium.org/65273002/diff/30001/content/common/geolocation_messages.h#newcode76 content/common/geolocation_messages.h:76: bool) Comment ...
7 years, 1 month ago (2013-11-08 12:27:27 UTC) #6
benm (inactive)
Hi guys, please take a look at PS6. I think we're almost there. This eliminates ...
7 years, 1 month ago (2013-11-08 19:26:30 UTC) #7
joth
Like it. This approach seems more contained. https://codereview.chromium.org/65273002/diff/250001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (right): https://codereview.chromium.org/65273002/diff/250001/content/browser/geolocation/geolocation_dispatcher_host.cc#newcode222 content/browser/geolocation/geolocation_dispatcher_host.cc:222: &(geolocation_renderers_[render_view_id]); nit: ...
7 years, 1 month ago (2013-11-08 20:41:14 UTC) #8
benm (inactive)
Thank you Joth! https://codereview.chromium.org/65273002/diff/250001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (right): https://codereview.chromium.org/65273002/diff/250001/content/browser/geolocation/geolocation_dispatcher_host.cc#newcode222 content/browser/geolocation/geolocation_dispatcher_host.cc:222: &(geolocation_renderers_[render_view_id]); On 2013/11/08 20:41:14, joth wrote: ...
7 years, 1 month ago (2013-11-08 21:10:28 UTC) #9
joth
On 2013/11/08 21:10:28, benm wrote: > Thank you Joth! > > https://codereview.chromium.org/65273002/diff/250001/content/browser/geolocation/geolocation_dispatcher_host.cc > File content/browser/geolocation/geolocation_dispatcher_host.cc ...
7 years, 1 month ago (2013-11-08 21:16:28 UTC) #10
benm (inactive)
PTAL. Still no test, I couldn't work where best to add one. Let's chat about ...
7 years, 1 month ago (2013-11-10 15:23:55 UTC) #11
joth
lgtm w/ 2 suggestions https://codereview.chromium.org/65273002/diff/380001/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/65273002/diff/380001/content/browser/android/content_view_core_impl.cc#newcode356 content/browser/android/content_view_core_impl.cc:356: } I think we could ...
7 years, 1 month ago (2013-11-10 17:59:02 UTC) #12
Michael van Ouwerkerk
https://codereview.chromium.org/65273002/diff/380001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (right): https://codereview.chromium.org/65273002/diff/380001/content/browser/geolocation/geolocation_dispatcher_host.cc#newcode144 content/browser/geolocation/geolocation_dispatcher_host.cc:144: Send(new GeolocationMsg_PositionUpdated(it->first, geoposition)); On 2013/11/10 17:59:02, joth wrote: > ...
7 years, 1 month ago (2013-11-11 14:19:48 UTC) #13
benm (inactive)
thanks all! https://codereview.chromium.org/65273002/diff/380001/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/65273002/diff/380001/content/browser/android/content_view_core_impl.cc#newcode356 content/browser/android/content_view_core_impl.cc:356: } On 2013/11/10 17:59:02, joth wrote: > ...
7 years, 1 month ago (2013-11-11 14:50:40 UTC) #14
benm (inactive)
Current plan for testing this is to add an AwGeolocationTest that will be inspired by ...
7 years, 1 month ago (2013-11-13 20:07:15 UTC) #15
benm (inactive)
Latest updates on this puppy (PS9 still needs some work but almost there... again :) ...
7 years ago (2013-11-27 20:12:22 UTC) #16
benm (inactive)
https://codereview.chromium.org/65273002/diff/650001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java File android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java (right): https://codereview.chromium.org/65273002/diff/650001/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java#newcode249 android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java:249: protected AwBrowserContext mBrowserContext = revert me
7 years ago (2013-11-27 20:29:30 UTC) #17
benm (inactive)
+mkosiba for eyes on the new AwGeolocationTest. It works perfectly on my local machine/device, however ...
7 years ago (2013-11-29 17:29:22 UTC) #18
Michael van Ouwerkerk
On 2013/11/29 17:29:22, benm wrote: > +mkosiba for eyes on the new AwGeolocationTest. > > ...
7 years ago (2013-11-29 19:09:58 UTC) #19
benm (inactive)
On 2013/11/29 19:09:58, Michael van Ouwerkerk wrote: > On 2013/11/29 17:29:22, benm wrote: > > ...
7 years ago (2013-11-29 23:16:59 UTC) #20
mkosiba (inactive)
On 2013/11/29 17:29:22, benm wrote: > +mkosiba for eyes on the new AwGeolocationTest. > > ...
7 years ago (2013-12-02 10:49:03 UTC) #21
mkosiba (inactive)
https://codereview.chromium.org/65273002/diff/750001/android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java File android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java (right): https://codereview.chromium.org/65273002/diff/750001/android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java#newcode30 android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java:30: private static final String RAW_HTML = nit, minimally shorter: ...
7 years ago (2013-12-02 10:49:31 UTC) #22
benm (inactive)
On 2013/12/02 10:49:03, mkosiba wrote: > On 2013/11/29 17:29:22, benm wrote: > > +mkosiba for ...
7 years ago (2013-12-03 17:00:27 UTC) #23
benm (inactive)
Hi reviewers, I think I'm pretty happy with PS18; it resolves the issues the WebView ...
7 years ago (2013-12-05 17:03:58 UTC) #24
mkosiba (inactive)
lgtm https://codereview.chromium.org/65273002/diff/830001/content/public/android/java/src/org/chromium/content/browser/LocationProvider.java File content/public/android/java/src/org/chromium/content/browser/LocationProvider.java (right): https://codereview.chromium.org/65273002/diff/830001/content/public/android/java/src/org/chromium/content/browser/LocationProvider.java#newcode42 content/public/android/java/src/org/chromium/content/browser/LocationProvider.java:42: public static void enableMockLocationProvider() { nit: I think ...
7 years ago (2013-12-09 16:26:07 UTC) #25
benm (inactive)
+bulach, can you take a look please? Thanks!
7 years ago (2013-12-11 11:01:27 UTC) #26
bulach
I have a couple of meetings right now, some comments so far, will finish in ...
7 years ago (2013-12-11 13:29:26 UTC) #27
mkosiba (inactive)
https://codereview.chromium.org/65273002/diff/870001/android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java File android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java (right): https://codereview.chromium.org/65273002/diff/870001/android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java#newcode111 android_webview/javatests/src/org/chromium/android_webview/test/GeolocationTest.java:111: @SmallTest On 2013/12/11 13:29:27, bulach wrote: > nit: I ...
7 years ago (2013-12-11 15:47:43 UTC) #28
bulach
lgtm, thanks! just a few more nits and suggestions... I think the most important comments ...
7 years ago (2013-12-11 15:48:39 UTC) #29
benm (inactive)
Thanks guys! I think all comments are addressed other than the PostTask, which I need ...
7 years ago (2013-12-11 20:08:45 UTC) #30
benm (inactive)
+sky for content/browser/renderer_host/render_process_host_impl.*
7 years ago (2013-12-11 20:50:01 UTC) #31
sky
LGTM
7 years ago (2013-12-11 21:40:58 UTC) #32
Michael van Ouwerkerk
lgtm https://codereview.chromium.org/65273002/diff/910001/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/65273002/diff/910001/content/browser/android/content_view_core_impl.cc#newcode269 content/browser/android/content_view_core_impl.cc:269: PauseOrResumeGeolocation(true); This line actually doesn't read well. Does ...
7 years ago (2013-12-12 14:45:02 UTC) #33
benm (inactive)
Thanks Michael! https://codereview.chromium.org/65273002/diff/910001/content/browser/android/content_view_core_impl.cc File content/browser/android/content_view_core_impl.cc (right): https://codereview.chromium.org/65273002/diff/910001/content/browser/android/content_view_core_impl.cc#newcode269 content/browser/android/content_view_core_impl.cc:269: PauseOrResumeGeolocation(true); On 2013/12/12 14:45:03, Michael van Ouwerkerk ...
7 years ago (2013-12-12 18:24:03 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benm@chromium.org/65273002/930001
7 years ago (2013-12-13 11:40:24 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benm@chromium.org/65273002/950001
7 years ago (2013-12-13 15:37:53 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/benm@chromium.org/65273002/950001
7 years ago (2013-12-13 19:19:06 UTC) #37
commit-bot: I haz the power
7 years ago (2013-12-13 19:43:54 UTC) #38
Message was sent while issue was closed.
Change committed as 240719

Powered by Google App Engine
This is Rietveld 408576698