| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
| 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 int tab_id, | 193 int tab_id, |
| 194 int process_id, | 194 int process_id, |
| 195 std::string* error) const; | 195 std::string* error) const; |
| 196 | 196 |
| 197 // Returns true if extension is allowed to obtain the contents of a page as | 197 // Returns true if extension is allowed to obtain the contents of a page as |
| 198 // an image. Since a page may contain sensitive information, this is | 198 // an image. Since a page may contain sensitive information, this is |
| 199 // restricted to the extension's host permissions as well as the extension | 199 // restricted to the extension's host permissions as well as the extension |
| 200 // page itself. | 200 // page itself. |
| 201 bool CanCaptureVisiblePage(int tab_id, std::string* error) const; | 201 bool CanCaptureVisiblePage(int tab_id, std::string* error) const; |
| 202 | 202 |
| 203 scoped_refptr<const PermissionSet> active_permissions() const { | 203 const scoped_refptr<const PermissionSet>& active_permissions() const { |
| 204 // TODO(dcheng): What is the point of this lock? |
| 204 base::AutoLock auto_lock(runtime_lock_); | 205 base::AutoLock auto_lock(runtime_lock_); |
| 205 return active_permissions_unsafe_; | 206 return active_permissions_unsafe_; |
| 206 } | 207 } |
| 207 | 208 |
| 208 scoped_refptr<const PermissionSet> withheld_permissions() const { | 209 const scoped_refptr<const PermissionSet>& withheld_permissions() const { |
| 209 base::AutoLock auto_lock(runtime_lock_); | 210 // TODO(dcheng): What is the point of this lock? |
| 210 return withheld_permissions_unsafe_; | 211 return withheld_permissions_unsafe_; |
| 211 } | 212 } |
| 212 | 213 |
| 213 #if defined(UNIT_TEST) | 214 #if defined(UNIT_TEST) |
| 214 scoped_refptr<const PermissionSet> GetTabSpecificPermissionsForTesting( | 215 scoped_refptr<const PermissionSet> GetTabSpecificPermissionsForTesting( |
| 215 int tab_id) const { | 216 int tab_id) const { |
| 216 return GetTabSpecificPermissions(tab_id); | 217 return GetTabSpecificPermissions(tab_id); |
| 217 } | 218 } |
| 218 #endif | 219 #endif |
| 219 | 220 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; | 268 mutable scoped_refptr<const PermissionSet> withheld_permissions_unsafe_; |
| 268 | 269 |
| 269 mutable TabPermissionsMap tab_specific_permissions_; | 270 mutable TabPermissionsMap tab_specific_permissions_; |
| 270 | 271 |
| 271 DISALLOW_COPY_AND_ASSIGN(PermissionsData); | 272 DISALLOW_COPY_AND_ASSIGN(PermissionsData); |
| 272 }; | 273 }; |
| 273 | 274 |
| 274 } // namespace extensions | 275 } // namespace extensions |
| 275 | 276 |
| 276 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ | 277 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_DATA_H_ |
| OLD | NEW |