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

Issue 801613004: Implement WebPermissionClient for Document and Worker contexts (Closed)

Created:
6 years ago by mlamouri (slow - plz ping)
Modified:
5 years, 9 months ago
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, mkwst+moarreviews-renderer_chromium.org, nasko+codewatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement WebPermissionClient for Document and Worker contexts It does enable Permissions.query() in Document and Worker context. It is using the mojo pipe associated to the RenderFrameImpl or BlinkPlatformImpl so the PermissionManager doesn't need to know in which context it lives. However, it needs to do some thread jumping to be back in the main thread. This is based on top of https://codereview.chromium.org/804553003 BUG=437770 Committed: https://crrev.com/670a86def14a54e127fdad702be51572a81532a8 Cr-Commit-Position: refs/heads/master@{#320927}

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 6

Patch Set 5 : review comments #

Total comments: 2

Patch Set 6 : review commetns #

Patch Set 7 : stupid compilerS #

Patch Set 8 : connect on demand #

Patch Set 9 : with comments #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+419 lines, -8 lines) Patch
M content/browser/permissions/permission_service_impl.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M content/child/blink_platform_impl.h View 1 2 3 4 4 chunks +5 lines, -0 lines 0 comments Download
M content/child/blink_platform_impl.cc View 1 2 3 4 5 6 7 5 chunks +21 lines, -4 lines 2 comments Download
A + content/child/permissions/OWNERS View 0 chunks +-1 lines, --1 lines 0 comments Download
A content/child/permissions/permission_manager.h View 1 2 3 4 5 6 7 8 1 chunk +87 lines, -0 lines 3 comments Download
A content/child/permissions/permission_manager.cc View 1 2 3 4 5 6 7 1 chunk +155 lines, -0 lines 3 comments Download
A content/child/permissions/permission_manager_thread_proxy.h View 1 2 3 4 1 chunk +54 lines, -0 lines 2 comments Download
A content/child/permissions/permission_manager_thread_proxy.cc View 1 2 3 4 1 chunk +74 lines, -0 lines 1 comment Download
M content/common/permission_service.mojom View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M content/content_child.gypi View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -2 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (11 generated)
mlamouri (slow - plz ping)
jochen@, can you have a look at the content/ changes. tsepez@, can you have a ...
5 years, 9 months ago (2015-03-06 12:21:52 UTC) #3
Tom Sepez
Mojom LGTM
5 years, 9 months ago (2015-03-06 17:48:27 UTC) #4
jochen (gone - plz use gerrit)
permissionClient vs permission*s*Manager is a bit odd, don't you think? https://codereview.chromium.org/801613004/diff/60001/content/child/permissions/permissions_manager.h File content/child/permissions/permissions_manager.h (right): https://codereview.chromium.org/801613004/diff/60001/content/child/permissions/permissions_manager.h#newcode72 ...
5 years, 9 months ago (2015-03-09 15:36:32 UTC) #5
mlamouri (slow - plz ping)
I can't agree more regarding the name. Even I was confused (something was writing PermissionManager ...
5 years, 9 months ago (2015-03-11 11:08:14 UTC) #6
mlamouri (slow - plz ping)
PTAL
5 years, 9 months ago (2015-03-11 11:08:23 UTC) #7
jochen (gone - plz use gerrit)
lgtm https://codereview.chromium.org/801613004/diff/80001/content/child/permissions/permission_manager.h File content/child/permissions/permission_manager.h (right): https://codereview.chromium.org/801613004/diff/80001/content/child/permissions/permission_manager.h#newcode27 content/child/permissions/permission_manager.h:27: public NON_EXPORTED_BASE(blink::WebPermissionClient) { more copy/paste?
5 years, 9 months ago (2015-03-11 16:06:56 UTC) #8
mlamouri (slow - plz ping)
https://codereview.chromium.org/801613004/diff/80001/content/child/permissions/permission_manager.h File content/child/permissions/permission_manager.h (right): https://codereview.chromium.org/801613004/diff/80001/content/child/permissions/permission_manager.h#newcode27 content/child/permissions/permission_manager.h:27: public NON_EXPORTED_BASE(blink::WebPermissionClient) { On 2015/03/11 at 16:06:56, jochen (slow) ...
5 years, 9 months ago (2015-03-11 17:13:18 UTC) #9
mlamouri (slow - plz ping)
https://codereview.chromium.org/801613004/diff/80001/content/child/permissions/permission_manager.h File content/child/permissions/permission_manager.h (right): https://codereview.chromium.org/801613004/diff/80001/content/child/permissions/permission_manager.h#newcode27 content/child/permissions/permission_manager.h:27: public NON_EXPORTED_BASE(blink::WebPermissionClient) { On 2015/03/11 at 16:06:56, jochen (slow) ...
5 years, 9 months ago (2015-03-11 17:13:19 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/801613004/100001
5 years, 9 months ago (2015-03-12 10:46:11 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/68077)
5 years, 9 months ago (2015-03-12 11:21:50 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/801613004/120001
5 years, 9 months ago (2015-03-12 11:26:36 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/42544)
5 years, 9 months ago (2015-03-12 15:01:27 UTC) #20
mlamouri (slow - plz ping)
jochen@, I had to do some changes in how I connect to the mojo service. ...
5 years, 9 months ago (2015-03-16 12:27:30 UTC) #21
jochen (gone - plz use gerrit)
still lgtm
5 years, 9 months ago (2015-03-17 14:16:50 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/801613004/160001
5 years, 9 months ago (2015-03-17 14:17:28 UTC) #25
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 9 months ago (2015-03-17 16:06:32 UTC) #26
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/670a86def14a54e127fdad702be51572a81532a8 Cr-Commit-Position: refs/heads/master@{#320927}
5 years, 9 months ago (2015-03-17 16:07:04 UTC) #27
Bernhard Bauer
5 years, 9 months ago (2015-03-23 18:27:42 UTC) #29
Message was sent while issue was closed.
Post-commit driveby review! Re-posting some comments from
https://codereview.chromium.org/990303002/, where this commit snuck in:

https://codereview.chromium.org/801613004/diff/160001/content/child/blink_pla...
File content/child/blink_platform_impl.cc (right):

https://codereview.chromium.org/801613004/diff/160001/content/child/blink_pla...
content/child/blink_platform_impl.cc:1087: if (!permission_client_.get())
scoped_ptr has an implicit conversion to bool, so the .get() isn't necessary.

https://codereview.chromium.org/801613004/diff/160001/content/child/blink_pla...
content/child/blink_platform_impl.cc:1094: main_thread_task_runner_.get(),
permission_client_.get());
What will happen if |main_thread_task_runner_| is null? IsMainThread() will
return false, but this will pass a null task runner.

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
File content/child/permissions/permission_manager.cc (right):

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager.cc:104: // callback will not leak.
In the case of |this| gets deleted, the
s/In the case of/In case/ (or "In the case of |this| getting deleted").

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager.cc:134: // gracefully fail,
destroying the callback too.
I don't understand this comment. The return value of PostTask is not checked.
And which callback is this about? The |callback| variable or the closure bound
below?

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager.cc:138: base::Unretained(callback),
Could you pass this base::Owned or in a scoped_ptr?

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
File content/child/permissions/permission_manager.h (right):

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager.h:43: protected:
Why protected? Is this class meant to be subclassed?

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager.h:53: static void
RunCallbackOnWorkerThread(
You could move this to an anonymous namespace in the .cc file.

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager.h:59: class CallbackInformation {
Can you only forward-declare this class here?

Also, types should go first in each section.

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
File content/child/permissions/permission_manager_thread_proxy.cc (right):

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager_thread_proxy.cc:24:
LazyInstance<ThreadLocalPointer<PermissionManagerThreadProxy>>::Leaky
Why do we need a separate instance of this class for each thread?

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
File content/child/permissions/permission_manager_thread_proxy.h (right):

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager_thread_proxy.h:23: class
PermissionManagerThreadProxy :
Can you add a comment that explains what this class does?

https://codereview.chromium.org/801613004/diff/160001/content/child/permissio...
content/child/permissions/permission_manager_thread_proxy.h:24: public
blink::WebPermissionClient,
Does this not fit on the previous line anymore?

Powered by Google App Engine
This is Rietveld 408576698