Issue metadata
Sign in to add a comment
|
Add Threadsafe API to PermissionManager for GetPermissionStatus |
||||||||||||||||||||||
Issue descriptionAdd threadsafe version of PermissionManager::GetPermissionStatus The PermissionManager is not threadsafe. However PermissionManager is built on top of host_content_settings_map. These maps have a contract that it can be read from any thread (but only written to on the UI thread). So, given a host_content_settings_map, we can implement PermissionManager::GetPermissionStatus thread safe way.
,
Oct 24 2016
As discussed in chat - I'm a bit wary of doing this because it implies that all code that would ever be used to query a permission must be threadsafe. Note that HostContentSettingsMap isn't the only source of permission data. We would want to carefully consider the implications before doing this.
,
Oct 24 2016
I just noticed your doc, so I added a comment there :)
,
Oct 24 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d6b19d48cf91f89c1ec414485b781f2ef2434521 commit d6b19d48cf91f89c1ec414485b781f2ef2434521 Author: dougt <dougt@chromium.org> Date: Mon Oct 24 15:52:42 2016 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 Review-Url: https://codereview.chromium.org/2439673004 Cr-Commit-Position: refs/heads/master@{#427078} [modify] https://crrev.com/d6b19d48cf91f89c1ec414485b781f2ef2434521/chrome/browser/permissions/permission_context_base.cc [modify] https://crrev.com/d6b19d48cf91f89c1ec414485b781f2ef2434521/chrome/browser/permissions/permission_context_base.h [modify] https://crrev.com/d6b19d48cf91f89c1ec414485b781f2ef2434521/chrome/browser/permissions/permission_manager.cc [modify] https://crrev.com/d6b19d48cf91f89c1ec414485b781f2ef2434521/chrome/browser/permissions/permission_manager.h [modify] https://crrev.com/d6b19d48cf91f89c1ec414485b781f2ef2434521/chrome/browser/permissions/permission_manager_unittest.cc
,
Oct 25 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c7d2c5a9df56e9a3a2cacc23fcb07ae93870d7b6 commit c7d2c5a9df56e9a3a2cacc23fcb07ae93870d7b6 Author: dougt <dougt@chromium.org> Date: Tue Oct 25 00:35:45 2016 Revert of Add threadsafe version of PermissionManager::GetPermissionStatus (patchset #5 id:80001 of https://codereview.chromium.org/2439673004/ ) Reason for revert: 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. Original issue's 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} TBR=mlamouri@chromium.org,jochen@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=658020 Review-Url: https://codereview.chromium.org/2446863002 Cr-Commit-Position: refs/heads/master@{#427189} [modify] https://crrev.com/c7d2c5a9df56e9a3a2cacc23fcb07ae93870d7b6/chrome/browser/permissions/permission_context_base.cc [modify] https://crrev.com/c7d2c5a9df56e9a3a2cacc23fcb07ae93870d7b6/chrome/browser/permissions/permission_context_base.h [modify] https://crrev.com/c7d2c5a9df56e9a3a2cacc23fcb07ae93870d7b6/chrome/browser/permissions/permission_manager.cc [modify] https://crrev.com/c7d2c5a9df56e9a3a2cacc23fcb07ae93870d7b6/chrome/browser/permissions/permission_manager.h [modify] https://crrev.com/c7d2c5a9df56e9a3a2cacc23fcb07ae93870d7b6/chrome/browser/permissions/permission_manager_unittest.cc
,
Oct 26 2016
We have agreed to delay this fix until we refactor the permission manager (Servicification). Assigning to raymes@chromium.org to hold on to.
,
Jun 7 2017
Issue 730290 has been merged into this issue.
,
Nov 10 2017
,
Feb 18 2018
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by benwells@chromium.org
, Oct 20 2016