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

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

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
« no previous file with comments | « extensions/common/message_bundle.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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_INFO_H_ 5 #ifndef EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_INFO_H_
6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_INFO_H_ 6 #define EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_INFO_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 const std::set<std::string>& permission_names) const; 49 const std::set<std::string>& permission_names) const;
50 50
51 // Checks if any permissions have names that start with |name| followed by a 51 // Checks if any permissions have names that start with |name| followed by a
52 // period. 52 // period.
53 bool HasChildPermissions(const std::string& name) const; 53 bool HasChildPermissions(const std::string& name) const;
54 54
55 // Gets the total number of API permissions. 55 // Gets the total number of API permissions.
56 size_t get_permission_count() const { return permission_count_; } 56 size_t get_permission_count() const { return permission_count_; }
57 57
58 private: 58 private:
59 friend struct base::DefaultLazyInstanceTraits<PermissionsInfo>; 59 friend struct base::LazyInstanceTraitsBase<PermissionsInfo>;
60 60
61 PermissionsInfo(); 61 PermissionsInfo();
62 62
63 virtual ~PermissionsInfo(); 63 virtual ~PermissionsInfo();
64 64
65 // Registers an |alias| for a given permission |name|. 65 // Registers an |alias| for a given permission |name|.
66 void RegisterAlias(const Alias& alias); 66 void RegisterAlias(const Alias& alias);
67 67
68 // Registers a permission with the specified attributes and flags. 68 // Registers a permission with the specified attributes and flags.
69 void RegisterPermission(std::unique_ptr<APIPermissionInfo> permission); 69 void RegisterPermission(std::unique_ptr<APIPermissionInfo> permission);
70 70
71 // Maps permission ids to permissions. Owns the permissions. 71 // Maps permission ids to permissions. Owns the permissions.
72 typedef std::map<APIPermission::ID, std::unique_ptr<APIPermissionInfo>> IDMap; 72 typedef std::map<APIPermission::ID, std::unique_ptr<APIPermissionInfo>> IDMap;
73 73
74 // Maps names and aliases to permissions. Doesn't own the permissions. 74 // Maps names and aliases to permissions. Doesn't own the permissions.
75 typedef std::map<std::string, APIPermissionInfo*> NameMap; 75 typedef std::map<std::string, APIPermissionInfo*> NameMap;
76 76
77 IDMap id_map_; 77 IDMap id_map_;
78 NameMap name_map_; 78 NameMap name_map_;
79 79
80 size_t permission_count_; 80 size_t permission_count_;
81 81
82 DISALLOW_COPY_AND_ASSIGN(PermissionsInfo); 82 DISALLOW_COPY_AND_ASSIGN(PermissionsInfo);
83 }; 83 };
84 84
85 } // namespace extensions 85 } // namespace extensions
86 86
87 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_INFO_H_ 87 #endif // EXTENSIONS_COMMON_PERMISSIONS_PERMISSIONS_INFO_H_
OLDNEW
« no previous file with comments | « extensions/common/message_bundle.cc ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698