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

Side by Side Diff: chrome/common/extensions/permissions/permissions_info.cc

Issue 10692160: Support socket endpoint permissions for AppsV2 Socket API. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase and fix a unit test Created 8 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "chrome/common/extensions/permissions/permissions_info.h" 5 #include "chrome/common/extensions/permissions/permissions_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace extensions { 9 namespace extensions {
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 DCHECK(name_map_.find(name) != name_map_.end()); 61 DCHECK(name_map_.find(name) != name_map_.end());
62 DCHECK(name_map_.find(alias) == name_map_.end()); 62 DCHECK(name_map_.find(alias) == name_map_.end());
63 name_map_[alias] = name_map_[name]; 63 name_map_[alias] = name_map_[name];
64 } 64 }
65 65
66 APIPermission* PermissionsInfo::RegisterPermission( 66 APIPermission* PermissionsInfo::RegisterPermission(
67 APIPermission::ID id, 67 APIPermission::ID id,
68 const char* name, 68 const char* name,
69 int l10n_message_id, 69 int l10n_message_id,
70 PermissionMessage::ID message_id, 70 PermissionMessage::ID message_id,
71 int flags) { 71 int flags,
72 const APIPermission::DetailConstructor detail_constructor) {
72 DCHECK(id_map_.find(id) == id_map_.end()); 73 DCHECK(id_map_.find(id) == id_map_.end());
73 DCHECK(name_map_.find(name) == name_map_.end()); 74 DCHECK(name_map_.find(name) == name_map_.end());
74 75
75 APIPermission* permission = new APIPermission( 76 APIPermission* permission = new APIPermission(
76 id, name, l10n_message_id, message_id, flags); 77 id, name, l10n_message_id, message_id, flags, detail_constructor);
77 78
78 id_map_[id] = permission; 79 id_map_[id] = permission;
79 name_map_[name] = permission; 80 name_map_[name] = permission;
80 81
81 permission_count_++; 82 permission_count_++;
82 83
83 return permission; 84 return permission;
84 } 85 }
85 86
86 } // namespace extensions 87 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/common/extensions/permissions/permissions_info.h ('k') | chrome/common/extensions/permissions/socket_permission.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698