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

Unified Diff: extensions/common/permissions/permissions_data.h

Issue 1057753003: [Extensions] Fix thread-safety bug in PermissionsData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jeffrey's Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/common/extension_messages.cc ('k') | extensions/common/permissions/permissions_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/permissions/permissions_data.h
diff --git a/extensions/common/permissions/permissions_data.h b/extensions/common/permissions/permissions_data.h
index e0f9b107a3b567e15da6797fc053410263206275..6a84566dc1cc5de553ea34dc1eb7c59ca72a5603 100644
--- a/extensions/common/permissions/permissions_data.h
+++ b/extensions/common/permissions/permissions_data.h
@@ -201,24 +201,21 @@ class PermissionsData {
// page itself.
bool CanCaptureVisiblePage(int tab_id, std::string* error) const;
- const scoped_refptr<const PermissionSet>& active_permissions() const {
+ // Returns the tab permissions map.
+ TabPermissionsMap CopyTabSpecificPermissionsMap() const;
+
+ scoped_refptr<const PermissionSet> active_permissions() const {
// We lock so that we can't also be setting the permissions while returning.
base::AutoLock auto_lock(runtime_lock_);
return active_permissions_unsafe_;
}
- const scoped_refptr<const PermissionSet>& withheld_permissions() const {
+ scoped_refptr<const PermissionSet> withheld_permissions() const {
// We lock so that we can't also be setting the permissions while returning.
base::AutoLock auto_lock(runtime_lock_);
return withheld_permissions_unsafe_;
}
- const TabPermissionsMap& tab_specific_permissions() const {
- // We lock so that we can't also be setting the permissions while returning.
- base::AutoLock auto_lock(runtime_lock_);
- return tab_specific_permissions_;
- }
-
#if defined(UNIT_TEST)
scoped_refptr<const PermissionSet> GetTabSpecificPermissionsForTesting(
int tab_id) const {
« no previous file with comments | « extensions/common/extension_messages.cc ('k') | extensions/common/permissions/permissions_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698