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

Issue 628773003: Partially convert geolocation IPC to Mojo. (Closed)

Created:
6 years, 2 months ago by blundell
Modified:
4 years, 11 months ago
CC:
chromium-reviews, creis+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, nasko+codewatch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, mkwst+moarreviews-ipc_chromium.org, Aaron Boodman, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, darin (slow to review), ben+mojo_chromium.org, vkuzkokov, dgozman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Partially convert geolocation IPC to Mojo. This CL converts the non-permissions-related geolocation IPC to Mojo. The Mojo GeolocationService interface allows clients to observe location updates. In //content, the service and its client connect on a per-frame basis, eliminating the need for the tracking of multiple frames that GeolocationDispatcherHost had previously been doing. To handle the fact that geolocation updates can be paused and resumed at per-WebContents granularity, we introduce a GeolocationServiceContext class, which is used to scope the granularity of pauses and resumes. Currently, GeolocationDispatcherHost still handles permissions-related geolocation IPC. This IPC will be moved to Mojo once there is resolution on what the right model for handling permissions there is. BUG=420497 TEST=Go to maps.google.com, allow location tracking, and check that your location is correctly pinpointed on the map. Committed: https://crrev.com/28e88081438dc08b06d5f05cfdd980c407db1638 Cr-Commit-Position: refs/heads/master@{#301604} Committed: https://crrev.com/c57b93f1e66e06bbddb07348a2816aa4a7df1051 Cr-Commit-Position: refs/heads/master@{#301824}

Patch Set 1 #

Patch Set 2 : Self-review #

Total comments: 5

Patch Set 3 : Fix Clang compile #

Patch Set 4 : Response to review, fix gn build #

Total comments: 15

Patch Set 5 : Handle WebContents going away #

Total comments: 14

Patch Set 6 : Response to review #

Total comments: 13

Patch Set 7 : Rebase, Add in https://codereview.chromium.org/667683002/ for testing #

Patch Set 8 : Response to reviews, port override impl #

Total comments: 12

Patch Set 9 : Response to review #

Patch Set 10 : Rebase, fix build error #

Total comments: 2

Patch Set 11 : Rebase #

Patch Set 12 : Start providing updates on connection #

Total comments: 2

Patch Set 13 : Process review, add security OWNERS #

Total comments: 12

Patch Set 14 : Response to review #

Patch Set 15 : Restrict mojom OWNERS to tsepez #

Patch Set 16 : Rebase #

Patch Set 17 : Rebase #

Patch Set 18 : Prevert crash when setting override #

Patch Set 19 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+528 lines, -306 lines) Patch
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -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 2 chunks +5 lines, -2 lines 0 comments Download
M content/browser/devtools/protocol/page_handler.cc View 1 2 3 4 5 6 7 4 chunks +7 lines, -7 lines 0 comments Download
M content/browser/frame_host/render_frame_host_delegate.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_delegate.cc View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +6 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +26 lines, -1 line 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 4 chunks +8 lines, -39 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 5 chunks +1 line, -160 lines 0 comments Download
A content/browser/geolocation/geolocation_service_context.h View 1 2 3 4 5 6 7 1 chunk +58 lines, -0 lines 0 comments Download
A content/browser/geolocation/geolocation_service_context.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +63 lines, -0 lines 0 comments Download
A content/browser/geolocation/geolocation_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +64 lines, -0 lines 0 comments Download
A content/browser/geolocation/geolocation_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +155 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +5 lines, -5 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +12 lines, -4 lines 0 comments Download
M content/common/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +2 lines, -0 lines 0 comments Download
M content/common/OWNERS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M content/common/geolocation_messages.h View 1 2 3 4 5 6 2 chunks +0 lines, -19 lines 0 comments Download
A content/common/geolocation_service.mojom View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +21 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +4 lines, -0 lines 0 comments Download
M content/content_common_mojo_bindings.gypi View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M content/public/common/BUILD.gn View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M content/public/common/OWNERS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
A + content/public/common/mojo_geoposition.mojom View 1 3 chunks +15 lines, -24 lines 0 comments Download
M content/renderer/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/geolocation_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +9 lines, -6 lines 0 comments Download
M content/renderer/geolocation_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +33 lines, -39 lines 0 comments Download

Messages

Total messages: 68 (13 generated)
blundell
6 years, 2 months ago (2014-10-07 11:16:04 UTC) #2
blundell
+timvolodine@
6 years, 2 months ago (2014-10-07 11:18:18 UTC) #4
blundell
https://codereview.chromium.org/628773003/diff/20001/content/browser/geolocation/geolocation_dispatcher_host.cc File content/browser/geolocation/geolocation_dispatcher_host.cc (left): https://codereview.chromium.org/628773003/diff/20001/content/browser/geolocation/geolocation_dispatcher_host.cc#oldcode226 content/browser/geolocation/geolocation_dispatcher_host.cc:226: high_accuracy = true; Note: I've introduced a behavioral change. ...
6 years, 2 months ago (2014-10-07 11:21:05 UTC) #5
qsr
https://codereview.chromium.org/628773003/diff/20001/content/browser/geolocation/geolocation_service_impl_context.cc File content/browser/geolocation/geolocation_service_impl_context.cc (right): https://codereview.chromium.org/628773003/diff/20001/content/browser/geolocation/geolocation_service_impl_context.cc#newcode30 content/browser/geolocation/geolocation_service_impl_context.cc:30: for (auto service : attached_services_) { You should be ...
6 years, 2 months ago (2014-10-07 13:03:59 UTC) #6
blundell
Thanks. https://codereview.chromium.org/628773003/diff/20001/content/browser/geolocation/geolocation_service_impl_context.cc File content/browser/geolocation/geolocation_service_impl_context.cc (right): https://codereview.chromium.org/628773003/diff/20001/content/browser/geolocation/geolocation_service_impl_context.cc#newcode30 content/browser/geolocation/geolocation_service_impl_context.cc:30: for (auto service : attached_services_) { On 2014/10/07 ...
6 years, 2 months ago (2014-10-07 14:35:24 UTC) #7
blundell
+brettw Brett, could you look at the changes to the GN files? Thanks!
6 years, 2 months ago (2014-10-07 14:35:54 UTC) #9
brettw
.gn files lgtm. In the future, you don't need to add me on these unless ...
6 years, 2 months ago (2014-10-07 16:32:14 UTC) #10
Michael van Ouwerkerk
Could you run the try bots? There are many Geolocation tests.
6 years, 2 months ago (2014-10-08 12:58:57 UTC) #11
blundell
On 2014/10/08 12:58:57, Michael van Ouwerkerk wrote: > Could you run the try bots? There ...
6 years, 2 months ago (2014-10-08 13:33:31 UTC) #12
Michael van Ouwerkerk
Sorry for the flurry of questions. I'm new to mojo. https://codereview.chromium.org/628773003/diff/60001/content/browser/frame_host/render_frame_host_delegate.h File content/browser/frame_host/render_frame_host_delegate.h (right): https://codereview.chromium.org/628773003/diff/60001/content/browser/frame_host/render_frame_host_delegate.h#newcode152 ...
6 years, 2 months ago (2014-10-08 14:13:08 UTC) #13
Michael van Ouwerkerk
https://codereview.chromium.org/628773003/diff/80001/content/browser/geolocation/geolocation_dispatcher_host.h File content/browser/geolocation/geolocation_dispatcher_host.h (right): https://codereview.chromium.org/628773003/diff/80001/content/browser/geolocation/geolocation_dispatcher_host.h#newcode26 content/browser/geolocation/geolocation_dispatcher_host.h:26: class GeolocationDispatcherHost : public WebContentsObserver { Heads up: changing ...
6 years, 2 months ago (2014-10-08 14:43:02 UTC) #14
blundell
Hi Michael, Thanks for the review! https://codereview.chromium.org/628773003/diff/60001/content/browser/frame_host/render_frame_host_delegate.h File content/browser/frame_host/render_frame_host_delegate.h (right): https://codereview.chromium.org/628773003/diff/60001/content/browser/frame_host/render_frame_host_delegate.h#newcode152 content/browser/frame_host/render_frame_host_delegate.h:152: virtual GeolocationServiceImplContext* GetGeolocationContext(); ...
6 years, 2 months ago (2014-10-09 08:32:52 UTC) #16
blundell
Michael, note that I've introduced a behavioral change. Before, if any frame wanted high accuracy, ...
6 years, 2 months ago (2014-10-09 08:37:24 UTC) #17
qsr
https://codereview.chromium.org/628773003/diff/120001/content/browser/geolocation/geolocation_service_impl.h File content/browser/geolocation/geolocation_service_impl.h (right): https://codereview.chromium.org/628773003/diff/120001/content/browser/geolocation/geolocation_service_impl.h#newcode32 content/browser/geolocation/geolocation_service_impl.h:32: virtual void StartUpdating(bool high_accuracy) OVERRIDE; If this is part ...
6 years, 2 months ago (2014-10-09 08:58:33 UTC) #18
Michael van Ouwerkerk
https://codereview.chromium.org/628773003/diff/120001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/628773003/diff/120001/content/browser/frame_host/render_frame_host_impl.cc#newcode208 content/browser/frame_host/render_frame_host_impl.cc:208: base::Unretained(delegate_->GetGeolocationServiceContext()), How does this work when GetGeolocationServiceContext() returns NULL? ...
6 years, 2 months ago (2014-10-09 13:11:23 UTC) #19
Michael van Ouwerkerk
On 2014/10/09 08:37:24, blundell wrote: > Michael, note that I've introduced a behavioral change. Before, ...
6 years, 2 months ago (2014-10-09 13:14:26 UTC) #20
blundell
On 2014/10/09 13:14:26, Michael van Ouwerkerk wrote: > On 2014/10/09 08:37:24, blundell wrote: > > ...
6 years, 2 months ago (2014-10-16 06:22:34 UTC) #21
blundell
+vkoskokov, dgozman FYI, as this CL now ports https://codereview.chromium.org/603323004/ to the Mojo impl Thanks for ...
6 years, 2 months ago (2014-10-21 12:27:50 UTC) #24
Michael van Ouwerkerk
https://codereview.chromium.org/628773003/diff/120001/content/renderer/geolocation_dispatcher.h File content/renderer/geolocation_dispatcher.h (right): https://codereview.chromium.org/628773003/diff/120001/content/renderer/geolocation_dispatcher.h#newcode51 content/renderer/geolocation_dispatcher.h:51: virtual void OnLocationUpdate(MojoGeopositionPtr geoposition) OVERRIDE; On 2014/10/21 12:27:50, blundell ...
6 years, 2 months ago (2014-10-21 12:47:21 UTC) #25
blundell
On 2014/10/21 12:47:21, Michael van Ouwerkerk wrote: > https://codereview.chromium.org/628773003/diff/120001/content/renderer/geolocation_dispatcher.h > File content/renderer/geolocation_dispatcher.h (right): > > ...
6 years, 2 months ago (2014-10-21 13:04:13 UTC) #26
Michael van Ouwerkerk
Nice, thanks! lgtm
6 years, 2 months ago (2014-10-21 13:45:41 UTC) #27
blundell
Thanks! OWNERS: +creis@ for //content outside of //content/browser/geolocation +tzepez@ for //content/common/geolocation_messages.h
6 years, 2 months ago (2014-10-21 13:56:05 UTC) #29
blundell
tsepez@: please review the new .mojom files as well, as well as any other parts ...
6 years, 2 months ago (2014-10-21 13:57:42 UTC) #30
Tom Sepez
I didn't follow the flow to see how the user provides confirmation that she wants ...
6 years, 2 months ago (2014-10-21 18:10:06 UTC) #31
blundell
Thanks! This CL changes nothing about the way geolocation permissions work. As before, it is ...
6 years, 2 months ago (2014-10-21 20:17:42 UTC) #32
Tom Sepez
LGTM. > (BTW, I personally was puzzled when grokking this code that the browser > ...
6 years, 2 months ago (2014-10-21 20:26:40 UTC) #33
Charlie Reis
Looks pretty good, and rubber stamp on the mojom files. One question below about how ...
6 years, 2 months ago (2014-10-21 22:28:32 UTC) #34
Aaron Boodman
https://codereview.chromium.org/628773003/diff/200001/content/common/geolocation_service.mojom File content/common/geolocation_service.mojom (right): https://codereview.chromium.org/628773003/diff/200001/content/common/geolocation_service.mojom#newcode17 content/common/geolocation_service.mojom:17: }; On 2014/10/21 20:17:41, blundell wrote: > On 2014/10/21 ...
6 years, 2 months ago (2014-10-22 00:25:38 UTC) #36
blundell
didn't manage to get to the code changes yet but wanted to respond to the ...
6 years, 2 months ago (2014-10-22 16:05:14 UTC) #37
Charlie Reis
Thanks. The rest are just nits, so LGTM once those are fixed. https://codereview.chromium.org/628773003/diff/200001/content/browser/geolocation/geolocation_service_context.cc File content/browser/geolocation/geolocation_service_context.cc ...
6 years, 2 months ago (2014-10-22 16:11:55 UTC) #38
blundell
Thanks! Filed crbug.com/426384. https://codereview.chromium.org/628773003/diff/200001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/628773003/diff/200001/content/browser/frame_host/render_frame_host_impl.cc#newcode1585 content/browser/frame_host/render_frame_host_impl.cc:1585: RenderFrameHost* top_frame = this; On 2014/10/21 ...
6 years, 2 months ago (2014-10-23 12:27:01 UTC) #39
blundell
https://codereview.chromium.org/628773003/diff/240001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/628773003/diff/240001/content/browser/frame_host/render_frame_host_impl.cc#newcode1587 content/browser/frame_host/render_frame_host_impl.cc:1587: RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); Charlie, could you just confirm ...
6 years, 2 months ago (2014-10-23 13:19:59 UTC) #40
blundell
Hi Michael, One more go-round: I changed the mojo interface so that the service starts ...
6 years, 2 months ago (2014-10-23 15:23:50 UTC) #41
blundell
tsepez: Could you look at geolocation_service.mojom again? Thanks!
6 years, 2 months ago (2014-10-23 15:33:51 UTC) #42
Charlie Reis
Still LGTM. https://codereview.chromium.org/628773003/diff/240001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/628773003/diff/240001/content/browser/frame_host/render_frame_host_impl.cc#newcode1587 content/browser/frame_host/render_frame_host_impl.cc:1587: RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); On 2014/10/23 13:19:59, ...
6 years, 2 months ago (2014-10-23 17:27:17 UTC) #43
Tom Sepez
Still LGTM.
6 years, 2 months ago (2014-10-23 18:02:03 UTC) #44
blundell
tsepez@: I added security owners for the mojom files in //content, following the security owners ...
6 years, 2 months ago (2014-10-24 09:57:12 UTC) #45
Michael van Ouwerkerk
Still lgtm - just a nit about omitting virtual when override is specified https://codereview.chromium.org/628773003/diff/300001/content/browser/geolocation/geolocation_dispatcher_host.h File ...
6 years, 2 months ago (2014-10-24 10:25:42 UTC) #46
blundell
https://codereview.chromium.org/628773003/diff/300001/content/browser/geolocation/geolocation_dispatcher_host.h File content/browser/geolocation/geolocation_dispatcher_host.h (right): https://codereview.chromium.org/628773003/diff/300001/content/browser/geolocation/geolocation_dispatcher_host.h#newcode32 content/browser/geolocation/geolocation_dispatcher_host.h:32: virtual void RenderFrameDeleted(RenderFrameHost* render_frame_host) override; On 2014/10/24 10:25:42, Michael ...
6 years, 2 months ago (2014-10-24 11:45:18 UTC) #47
Tom Sepez
On 2014/10/24 09:57:12, blundell wrote: > tsepez@: I added security owners for the mojom files ...
6 years, 2 months ago (2014-10-24 16:54:13 UTC) #48
blundell
On 2014/10/24 16:54:13, Tom Sepez wrote: > On 2014/10/24 09:57:12, blundell wrote: > > tsepez@: ...
6 years, 1 month ago (2014-10-27 16:31:46 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/628773003/360001
6 years, 1 month ago (2014-10-28 09:22:19 UTC) #51
commit-bot: I haz the power
Committed patchset #16 (id:360001)
6 years, 1 month ago (2014-10-28 11:58:27 UTC) #52
commit-bot: I haz the power
Patchset 16 (id:??) landed as https://crrev.com/28e88081438dc08b06d5f05cfdd980c407db1638 Cr-Commit-Position: refs/heads/master@{#301604}
6 years, 1 month ago (2014-10-28 11:59:05 UTC) #53
yurys
A revert of this CL (patchset #16 id:360001) has been created in https://codereview.chromium.org/680323002/ by yurys@chromium.org. ...
6 years, 1 month ago (2014-10-28 13:26:08 UTC) #54
blundell
Michael, This CL was reverted because it caused a LayoutTests crash, which turned out to ...
6 years, 1 month ago (2014-10-29 11:00:56 UTC) #56
Michael van Ouwerkerk
lgtm
6 years, 1 month ago (2014-10-29 11:06:52 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/628773003/420001
6 years, 1 month ago (2014-10-29 11:37:44 UTC) #59
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel/builds/7134) linux_chromium_compile_dbg_32 on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32/builds/5428)
6 years, 1 month ago (2014-10-29 11:42:41 UTC) #61
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/628773003/440001
6 years, 1 month ago (2014-10-29 12:04:37 UTC) #63
commit-bot: I haz the power
Committed patchset #19 (id:440001)
6 years, 1 month ago (2014-10-29 13:20:07 UTC) #64
commit-bot: I haz the power
Patchset 19 (id:??) landed as https://crrev.com/c57b93f1e66e06bbddb07348a2816aa4a7df1051 Cr-Commit-Position: refs/heads/master@{#301824}
6 years, 1 month ago (2014-10-29 13:21:01 UTC) #65
jam
I just saw this why is content/public/common/mojo_geoposition.mojom in content/public/common instead of content/common? since it's not ...
4 years, 11 months ago (2016-01-26 22:56:06 UTC) #66
Ben Goodger (Google)
On 2016/01/26 22:56:06, jam wrote: > I just saw this > > why is content/public/common/mojo_geoposition.mojom ...
4 years, 11 months ago (2016-01-26 22:58:53 UTC) #67
blundell
4 years, 11 months ago (2016-01-28 09:45:22 UTC) #68
Message was sent while issue was closed.
On 2016/01/26 22:58:53, Ben Goodger (Google) wrote:
> On 2016/01/26 22:56:06, jam wrote:
> > I just saw this
> > 
> > why is 	content/public/common/mojo_geoposition.mojom in
> > content/public/common instead of content/common? since it's not used by
anyone
> > outside content, it should be in content/common.
> > 
> > please move it, per
> > https://www.chromium.org/developers/content-module/content-api
> 
> Some nits too:
> 
> struct MojoGeoposition -> struct Geoposition
> filename mojo_geoposition.mojom -> geoposition.mojom

The answer to all three of these points is that
//content/public/common/geoposition.h defines content::Geoposition, which the
Mojo struct was intended to globally replace (see the comment in
mojo_geoposition.mojom). However, I haven't kept up with how the allowance of
C++ types in mojoms might affect this. Would it now be possible to directly use
geoposition.h in the mojom interfaces instead?

> module content { .. } -> module content.mojom;

Holding off on this pending resolution of the above question.

Powered by Google App Engine
This is Rietveld 408576698