|
|
DescriptionAdd 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
Messages
Total messages: 35 (26 generated)
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== 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 Add DCHECKs for thread access PermissionManager. The PermissionManager is not thread safe. Lets add some DCHECKs to let us know when there is an unsafe access. BUG=658018 R=jochen ========== to ========== 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 ==========
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
mlamouri@chromium.org changed reviewers: + mlamouri@chromium.org
Can you add unit tests? It shouldn't be very painful because there are already some :) Also, I understand the theoretical need for this but in practice, do we have consumers? https://codereview.chromium.org/2439673004/diff/40001/chrome/browser/permissi... File chrome/browser/permissions/permission_context_base.cc (right): https://codereview.chromium.org/2439673004/diff/40001/chrome/browser/permissi... chrome/browser/permissions/permission_context_base.cc:144: HostContentSettingsMap* host = If that method needs to be called from the UI thread, maybe add a DCHECK? https://codereview.chromium.org/2439673004/diff/40001/chrome/browser/permissi... File chrome/browser/permissions/permission_context_base.h (right): https://codereview.chromium.org/2439673004/diff/40001/chrome/browser/permissi... chrome/browser/permissions/permission_context_base.h:100: // Withdraw an existing permission reqUest, no op if the permission request typo: s/reqUest/request/
np. I'll test that GetPermissionStatus can be used from a non-main thread. > Also, I understand the theoretical need for this but in practice, do we have > consumers? See https://codereview.chromium.org/2441083002/ The storage policy code now calls into GetPermissionStatus from a non-main thread. in_reply_to: 5718998062727168 subject: Add threadsafe version of PermissionManager::GetPermissionStatus
np. I'll test that GetPermissionStatus can be used from a non-main thread. > Also, I understand the theoretical need for this but in practice, do we have > consumers? See https://codereview.chromium.org/2441083002/ The storage policy code now calls into GetPermissionStatus from a non-main thread. in_reply_to: 5718998062727168 subject: Add threadsafe version of PermissionManager::GetPermissionStatus
Description was changed from ========== 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 ========== to ========== 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 ==========
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by dougt@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2439673004/diff/80001/chrome/browser/permissi... File chrome/browser/permissions/permission_manager_unittest.cc (right): https://codereview.chromium.org/2439673004/diff/80001/chrome/browser/permissi... chrome/browser/permissions/permission_manager_unittest.cc:135: run_loop.Run(); Looks fine but I would have done this a bit differently: - one test checking that calling the regular GetPermissionStatus on DEBUG will crash - one test checking that calling the GetPermissionStatus will HostContentSettingsMap returns the correct value (and doesn't crash ;)) I'm not super comfortable with the magic thread-check in the test. However, lgtm either way :)
The CQ bit was checked by dougt@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from jochen@chromium.org Link to the patchset: https://codereview.chromium.org/2439673004/#ps80001 (title: "Use thread_bundle_ REAL_IO_THREAD to ensure multi-thread testing")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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 ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/d6b19d48cf91f89c1ec414485b781f2ef2434521 Cr-Commit-Position: refs/heads/master@{#427078}
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. .
Message was sent while issue was closed.
Description was changed from ========== 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} ========== to ========== 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} ========== |