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

Issue 722153003: Implement basic mojo Permission service and use it for Geolocation. (Closed)

Created:
6 years, 1 month ago by mlamouri (slow - plz ping)
Modified:
6 years, 1 month ago
CC:
chromium-reviews, creis+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, nasko+codewatch_chromium.org, jam, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin-cc_chromium.org, Michael van Ouwerkerk, mkwst+moarreviews-renderer_chromium.org, darin (slow to review), ben+mojo_chromium.org, timvolodine, Peter Beverloo, Miguel Garcia
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Implement basic mojo Permission service and use it for Geolocation. This is implementing one side of the mojo Permission service: requesting a permission. This is being used by the Geolocation code in the renderer process. This CL is creating all the required hooks for the permission service and can be used as a base to increment on top of. BUG=430238, 420497 Committed: https://crrev.com/4ebe69f4f611e1eef0d8886b97abdae37687a14b Cr-Commit-Position: refs/heads/master@{#304227}

Patch Set 1 #

Patch Set 2 : #

Total comments: 25

Patch Set 3 : review comments #

Total comments: 19

Patch Set 4 : review comments #

Patch Set 5 : rename HasPermission() to QueryPermission() #

Total comments: 2

Patch Set 6 : review comments #

Total comments: 4

Patch Set 7 : review comments #

Total comments: 24

Patch Set 8 : review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+391 lines, -300 lines) Patch
M content/browser/frame_host/render_frame_host_impl.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M content/browser/geolocation/geolocation_dispatcher_host.h View 1 1 chunk +0 lines, -76 lines 0 comments Download
M content/browser/geolocation/geolocation_dispatcher_host.cc View 1 1 chunk +0 lines, -144 lines 0 comments Download
A content/browser/permissions/permission_service_context.h View 1 2 3 4 5 6 7 1 chunk +51 lines, -0 lines 0 comments Download
A content/browser/permissions/permission_service_context.cc View 1 2 3 4 5 1 chunk +63 lines, -0 lines 0 comments Download
A content/browser/permissions/permission_service_impl.h View 1 2 3 4 5 6 7 1 chunk +73 lines, -0 lines 0 comments Download
A content/browser/permissions/permission_service_impl.cc View 1 2 3 4 5 6 7 1 chunk +120 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 3 chunks +7 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 2 chunks +0 lines, -3 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 2 chunks +0 lines, -2 lines 0 comments Download
M content/common/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M content/common/content_message_generator.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M content/common/geolocation_messages.h View 1 1 chunk +0 lines, -46 lines 0 comments Download
A content/common/permission_service.mojom View 1 2 3 4 5 6 7 1 chunk +25 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 2 chunks +4 lines, -2 lines 0 comments Download
M content/content_common.gypi View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M content/content_common_mojo_bindings.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/geolocation_dispatcher.h View 1 2 3 4 5 4 chunks +3 lines, -4 lines 0 comments Download
M content/renderer/geolocation_dispatcher.cc View 1 2 3 4 5 3 chunks +26 lines, -21 lines 0 comments Download

Messages

Total messages: 32 (7 generated)
mlamouri (slow - plz ping)
tsepez@chromium.org: Please review changes in: - content/common/ creis@chromium.org: Please review changes in: - content/ (OWNER ...
6 years, 1 month ago (2014-11-13 22:05:31 UTC) #3
mlamouri (slow - plz ping)
nasko@, if you happen to have some time to have a look, it will be ...
6 years, 1 month ago (2014-11-13 22:09:54 UTC) #5
Tom Sepez
Messages themselves LGTM. https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_impl.cc File content/browser/permissions/permission_service_impl.cc (right): https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_impl.cc#newcode23 content/browser/permissions/permission_service_impl.cc:23: return PERMISSION_NUM; nit: name doesn't make ...
6 years, 1 month ago (2014-11-13 22:51:42 UTC) #6
mlamouri (slow - plz ping)
https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_impl.cc File content/browser/permissions/permission_service_impl.cc (right): https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_impl.cc#newcode23 content/browser/permissions/permission_service_impl.cc:23: return PERMISSION_NUM; On 2014/11/13 22:51:42, Tom Sepez wrote: > ...
6 years, 1 month ago (2014-11-13 22:58:42 UTC) #7
Tom Sepez
On 2014/11/13 22:58:42, Mounir Lamouri wrote: > https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_impl.cc > File content/browser/permissions/permission_service_impl.cc (right): > > https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_impl.cc#newcode23 ...
6 years, 1 month ago (2014-11-13 23:17:35 UTC) #8
nasko
Apologies for the amount of questions, but this is the first time I see mojo ...
6 years, 1 month ago (2014-11-13 23:57:38 UTC) #9
mlamouri (slow - plz ping)
https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_context.h File content/browser/permissions/permission_service_context.h (right): https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_context.h#newcode17 content/browser/permissions/permission_service_context.h:17: // PermissionService to handle request permission UI. On 2014/11/13 ...
6 years, 1 month ago (2014-11-14 00:16:34 UTC) #10
mlamouri (slow - plz ping)
nasko@, I've applied the comments. PTAL. Regarding mojo specificities, blundell@, in the reviewer list, knows ...
6 years, 1 month ago (2014-11-14 00:29:29 UTC) #12
nasko
LGTM once the comments are addressed. https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_impl.cc File content/browser/permissions/permission_service_impl.cc (right): https://codereview.chromium.org/722153003/diff/20001/content/browser/permissions/permission_service_impl.cc#newcode54 content/browser/permissions/permission_service_impl.cc:54: if (!context_->render_frame_host()) { ...
6 years, 1 month ago (2014-11-14 00:42:50 UTC) #13
blundell
This looks good to me overall, nice work! A couple high-level comments: - If the ...
6 years, 1 month ago (2014-11-14 08:29:20 UTC) #14
blundell
https://codereview.chromium.org/722153003/diff/40001/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/722153003/diff/40001/content/browser/renderer_host/render_process_host_impl.cc#newcode884 content/browser/renderer_host/render_process_host_impl.cc:884: base::Bind(&PermissionServiceImpl::Create, I think you should delay adding this until ...
6 years, 1 month ago (2014-11-14 08:31:13 UTC) #15
qsr
https://codereview.chromium.org/722153003/diff/40001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/722153003/diff/40001/content/browser/frame_host/render_frame_host_impl.cc#newcode1277 content/browser/frame_host/render_frame_host_impl.cc:1277: base::Passed(&permission_service_context))); This callback will be run each time something ...
6 years, 1 month ago (2014-11-14 09:20:26 UTC) #17
mlamouri (slow - plz ping)
I applied the comments. blundell@ and qsr@, there is only the question of the Context/Service ...
6 years, 1 month ago (2014-11-14 11:37:11 UTC) #18
qsr
https://codereview.chromium.org/722153003/diff/40001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/722153003/diff/40001/content/browser/frame_host/render_frame_host_impl.cc#newcode1277 content/browser/frame_host/render_frame_host_impl.cc:1277: base::Passed(&permission_service_context))); On 2014/11/14 11:37:11, Mounir Lamouri wrote: > On ...
6 years, 1 month ago (2014-11-14 11:49:27 UTC) #19
blundell
https://codereview.chromium.org/722153003/diff/80001/content/renderer/geolocation_dispatcher.cc File content/renderer/geolocation_dispatcher.cc (right): https://codereview.chromium.org/722153003/diff/80001/content/renderer/geolocation_dispatcher.cc#newcode91 content/renderer/geolocation_dispatcher.cc:91: weak_ptr_factory_.GetWeakPtr(), This doesn't need to be a weak ptr, ...
6 years, 1 month ago (2014-11-14 12:11:52 UTC) #20
mlamouri (slow - plz ping)
I think I applied all your comments in this new patch. PTAL and let me ...
6 years, 1 month ago (2014-11-14 12:38:48 UTC) #21
blundell
https://codereview.chromium.org/722153003/diff/100001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/722153003/diff/100001/content/browser/frame_host/render_frame_host_impl.cc#newcode1255 content/browser/frame_host/render_frame_host_impl.cc:1255: permission_service_context_.reset(new PermissionServiceContext(this)); nit: I think this might as well ...
6 years, 1 month ago (2014-11-14 12:48:08 UTC) #22
mlamouri (slow - plz ping)
PTAL https://codereview.chromium.org/722153003/diff/100001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/722153003/diff/100001/content/browser/frame_host/render_frame_host_impl.cc#newcode1255 content/browser/frame_host/render_frame_host_impl.cc:1255: permission_service_context_.reset(new PermissionServiceContext(this)); On 2014/11/14 12:48:08, blundell wrote: > ...
6 years, 1 month ago (2014-11-14 13:39:42 UTC) #23
qsr
https://codereview.chromium.org/722153003/diff/120001/content/browser/permissions/permission_service_impl.cc File content/browser/permissions/permission_service_impl.cc (right): https://codereview.chromium.org/722153003/diff/120001/content/browser/permissions/permission_service_impl.cc#newcode117 content/browser/permissions/permission_service_impl.cc:117: NOTIMPLEMENTED(); I still do not understand that. If you ...
6 years, 1 month ago (2014-11-14 14:28:18 UTC) #24
blundell
Given that PermissionServiceImpl is //content-specific at this time (which I'm OK with), I think that ...
6 years, 1 month ago (2014-11-14 14:42:00 UTC) #25
mlamouri (slow - plz ping)
Comments applied. blundell@ told me offline that his comments were the last he had and ...
6 years, 1 month ago (2014-11-14 16:14:45 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/722153003/140001
6 years, 1 month ago (2014-11-14 16:16:34 UTC) #29
commit-bot: I haz the power
Committed patchset #8 (id:140001)
6 years, 1 month ago (2014-11-14 17:25:30 UTC) #30
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/4ebe69f4f611e1eef0d8886b97abdae37687a14b Cr-Commit-Position: refs/heads/master@{#304227}
6 years, 1 month ago (2014-11-14 17:26:13 UTC) #31
blundell
6 years, 1 month ago (2014-11-17 13:14:01 UTC) #32
Message was sent while issue was closed.
https://codereview.chromium.org/722153003/diff/120001/content/browser/permiss...
File content/browser/permissions/permission_service_impl.cc (right):

https://codereview.chromium.org/722153003/diff/120001/content/browser/permiss...
content/browser/permissions/permission_service_impl.cc:65: int request_id =
pending_requests_.Add(
On 2014/11/14 16:14:45, Mounir Lamouri wrote:
> On 2014/11/14 14:41:59, blundell wrote:
> > Not for this CL, but when would a PermissionService receive more than 1
> incoming
> > request at a time?
> 
> This is definitely possible. Have you ever seen those infobar stacks? They can
> all come from the same RenderFrame. In the current implementation, aware of
only
> Geolocation, it's quite unlikely though ;)

More than 1 incoming request per RenderFrame at a time is not the same thing as
a given PermissionsServiceImpl instance receiving more than 1 incoming request
at a time. Keep in mind that each different client will connect to a different
PermissionServiceImpl instance.

Powered by Google App Engine
This is Rietveld 408576698