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

Issue 2439673004: Add threadsafe version of PermissionManager::GetPermissionStatus (Closed)

Created:
4 years, 2 months ago by dougt
Modified:
3 years, 11 months ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add threadsafe version of PermissionManager::GetPermissionStatus Add a version of GetPermissionStatus that takes a host_content_settings_map. This method is guaranteed to be threadsafe. BUG=658020 R=jochen, mlamouri Committed: https://crrev.com/d6b19d48cf91f89c1ec414485b781f2ef2434521 Cr-Commit-Position: refs/heads/master@{#427078}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : remove override #

Total comments: 2

Patch Set 4 : Fix comment typo in permission_context_base.h #

Patch Set 5 : Use thread_bundle_ REAL_IO_THREAD to ensure multi-thread testing #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -13 lines) Patch
M chrome/browser/permissions/permission_context_base.h View 1 2 3 3 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_context_base.cc View 2 chunks +11 lines, -4 lines 0 comments Download
M chrome/browser/permissions/permission_manager.h View 1 2 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_manager.cc View 1 1 chunk +16 lines, -0 lines 0 comments Download
M chrome/browser/permissions/permission_manager_unittest.cc View 1 2 3 4 4 chunks +39 lines, -9 lines 1 comment Download

Messages

Total messages: 35 (26 generated)
jochen (gone - plz use gerrit)
lgtm
4 years, 2 months ago (2016-10-21 17:52:47 UTC) #10
mlamouri (slow - plz ping)
Can you add unit tests? It shouldn't be very painful because there are already some ...
4 years, 2 months ago (2016-10-22 11:36:38 UTC) #14
dougt
np. I'll test that GetPermissionStatus can be used from a non-main thread. > Also, I ...
4 years, 2 months ago (2016-10-23 08:06:48 UTC) #15
dougt
np. I'll test that GetPermissionStatus can be used from a non-main thread. > Also, I ...
4 years, 2 months ago (2016-10-23 08:06:49 UTC) #16
mlamouri (slow - plz ping)
https://codereview.chromium.org/2439673004/diff/80001/chrome/browser/permissions/permission_manager_unittest.cc File chrome/browser/permissions/permission_manager_unittest.cc (right): https://codereview.chromium.org/2439673004/diff/80001/chrome/browser/permissions/permission_manager_unittest.cc#newcode135 chrome/browser/permissions/permission_manager_unittest.cc:135: run_loop.Run(); Looks fine but I would have done this ...
4 years, 1 month ago (2016-10-24 10:40:51 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2439673004/80001
4 years, 1 month ago (2016-10-24 15:40:20 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 1 month ago (2016-10-24 15:53:10 UTC) #31
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/d6b19d48cf91f89c1ec414485b781f2ef2434521 Cr-Commit-Position: refs/heads/master@{#427078}
4 years, 1 month ago (2016-10-24 16:19:20 UTC) #33
dougt
4 years, 1 month ago (2016-10-25 00:06:38 UTC) #34
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:80001) has been created in
https://codereview.chromium.org/2446863002/ by dougt@chromium.org.

The reason for reverting is: Going to address a number of issues that Raymes
pointed out including:

1) It's unclear the purpose the overloaded GetPermissionStatus function (see
https://google.github.io/styleguide/cppguide.html#Function_Overloading). It
could be good to name it something that reflects its usage from a background
thread.

2) In PermissionManager, it's unclear that it is threadsafe while the rest of
the class isn't - we should add a comment.

3) It's unclear why HostContentSettingsMap needs to be passed in - it's already
available in the PermissionContextBase.

4) I feel like it would be better to leave the default implementation empty in
the PermissionContextBase and have NOTREACHED. Then if someone really wants to
support querying a permission safely from a background thread, they have to
think about it.

.

Powered by Google App Engine
This is Rietveld 408576698