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

Unified Diff: chrome/browser/extensions/permissions_updater.cc

Issue 508513002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Two more Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/permissions_updater.cc
diff --git a/chrome/browser/extensions/permissions_updater.cc b/chrome/browser/extensions/permissions_updater.cc
index f28ecdd9057d92101a9afb4bd0e2d617a92f2c9a..1b13c6750748c7e5d0e1899e73b421aaa7fb1472 100644
--- a/chrome/browser/extensions/permissions_updater.cc
+++ b/chrome/browser/extensions/permissions_updater.cc
@@ -64,7 +64,7 @@ scoped_refptr<const PermissionSet> GetBoundedActivePermissions(
// If the extension has used the optional permissions API, it will have a
// custom set of active permissions defined in the extension prefs. Here,
// we update the extension's active permissions based on the prefs.
- if (!active_permissions)
+ if (!active_permissions.get())
return extension->permissions_data()->active_permissions();
scoped_refptr<const PermissionSet> required_permissions =
@@ -75,16 +75,17 @@ scoped_refptr<const PermissionSet> GetBoundedActivePermissions(
// a) active permissions must be a subset of optional + default permissions
// b) active permissions must contains all default permissions
scoped_refptr<PermissionSet> total_permissions = PermissionSet::CreateUnion(
- required_permissions,
+ required_permissions.get(),
PermissionsParser::GetOptionalPermissions(extension));
// Make sure the active permissions contain no more than optional + default.
scoped_refptr<PermissionSet> adjusted_active =
- PermissionSet::CreateIntersection(total_permissions, active_permissions);
+ PermissionSet::CreateIntersection(total_permissions.get(),
+ active_permissions.get());
// Make sure the active permissions contain the default permissions.
- adjusted_active =
- PermissionSet::CreateUnion(required_permissions, adjusted_active);
+ adjusted_active = PermissionSet::CreateUnion(required_permissions.get(),
+ adjusted_active.get());
return adjusted_active;
}
@@ -194,7 +195,7 @@ void PermissionsUpdater::InitializePermissions(const Extension* extension) {
// For example, the union of <all_urls> and "example.com" is <all_urls>, so
// we may lose "example.com". However, "example.com" is important once
// <all_urls> is stripped during withholding.
- if (active_permissions) {
+ if (active_permissions.get()) {
granted_explicit_hosts.AddPatterns(
FilterSingleOriginPermissions(active_permissions->explicit_hosts(),
bounded_active->explicit_hosts()));

Powered by Google App Engine
This is Rietveld 408576698