diff options
author | rdevlin.cronin <rdevlin.cronin@chromium.org> | 2015-09-30 13:19:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-30 20:20:45 +0000 |
commit | d630c304b8d53e1e068d5ef094f14b70507f4844 (patch) | |
tree | e0eb6e1a3cd07b51caedb2f2f014af5bff91c0d2 /extensions/common/manifest_handlers | |
parent | 3f38c02b4c4f4d10b7350bf492a05c9215b8b656 (diff) | |
download | chromium_src-d630c304b8d53e1e068d5ef094f14b70507f4844.zip chromium_src-d630c304b8d53e1e068d5ef094f14b70507f4844.tar.gz chromium_src-d630c304b8d53e1e068d5ef094f14b70507f4844.tar.bz2 |
[Extensions] Make const PermissionSet* const PermissionSet& where possible
Replace a bunch of pointers with const&.
TBR=pkotwicz@chromium.org (themes)
TBR=atwilson@chromium.org (background)
TBR=rogerta@chromium.org (ui/sync)
BUG=455414
Review URL: https://codereview.chromium.org/1365443003
Cr-Commit-Position: refs/heads/master@{#351631}
Diffstat (limited to 'extensions/common/manifest_handlers')
3 files changed, 11 insertions, 11 deletions
diff --git a/extensions/common/manifest_handlers/permissions_parser.cc b/extensions/common/manifest_handlers/permissions_parser.cc index 1aa2e60..a7c6db9 100644 --- a/extensions/common/manifest_handlers/permissions_parser.cc +++ b/extensions/common/manifest_handlers/permissions_parser.cc @@ -318,21 +318,21 @@ void PermissionsParser::SetScriptableHosts( } // static -const PermissionSet* PermissionsParser::GetRequiredPermissions( +const PermissionSet& PermissionsParser::GetRequiredPermissions( const Extension* extension) { DCHECK(extension->GetManifestData(keys::kPermissions)); - return static_cast<const ManifestPermissions*>( - extension->GetManifestData(keys::kPermissions)) - ->permissions.get(); + return *static_cast<const ManifestPermissions*>( + extension->GetManifestData(keys::kPermissions)) + ->permissions; } // static -const PermissionSet* PermissionsParser::GetOptionalPermissions( +const PermissionSet& PermissionsParser::GetOptionalPermissions( const Extension* extension) { DCHECK(extension->GetManifestData(keys::kOptionalPermissions)); - return static_cast<const ManifestPermissions*>( - extension->GetManifestData(keys::kOptionalPermissions)) - ->permissions.get(); + return *static_cast<const ManifestPermissions*>( + extension->GetManifestData(keys::kOptionalPermissions)) + ->permissions; } } // namespace extensions diff --git a/extensions/common/manifest_handlers/permissions_parser.h b/extensions/common/manifest_handlers/permissions_parser.h index 645017d1b..2844d2a 100644 --- a/extensions/common/manifest_handlers/permissions_parser.h +++ b/extensions/common/manifest_handlers/permissions_parser.h @@ -45,9 +45,9 @@ class PermissionsParser { // Return the extension's manifest-specified permissions. In no cases should // these permissions be used to determine if an action is allowed. Instead, // use PermissionsData. - static const PermissionSet* GetRequiredPermissions( + static const PermissionSet& GetRequiredPermissions( const Extension* extension); - static const PermissionSet* GetOptionalPermissions( + static const PermissionSet& GetOptionalPermissions( const Extension* extension); private: diff --git a/extensions/common/manifest_handlers/shared_module_info.cc b/extensions/common/manifest_handlers/shared_module_info.cc index 8fd1ab9..ecd68da 100644 --- a/extensions/common/manifest_handlers/shared_module_info.cc +++ b/extensions/common/manifest_handlers/shared_module_info.cc @@ -218,7 +218,7 @@ bool SharedModuleHandler::Validate( // own, instead they rely on the permissions of the extensions which import // them. if (SharedModuleInfo::IsSharedModule(extension) && - !extension->permissions_data()->active_permissions()->IsEmpty()) { + !extension->permissions_data()->active_permissions().IsEmpty()) { *error = errors::kInvalidExportPermissions; return false; } |