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

Side by Side Diff: extensions/common/permissions/permissions_data.h

Issue 510313002: Extensions-related fixups for scoped_refptr conversion operator removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
OLDNEW
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
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
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_
OLDNEW
« 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