[Extensions] Un-refcount PermissionSet

PermissionSet represents a set of permissions, and for some reason,
it's been refcounted. There's really no reason to have it, and it
makes everything more costly and difficult to reason about. Remove the
refcounting.

Note: This is part 1 of a 2-part series. This removes the ref-counting.
In a followup, I'll go through and update many of the places that
use const PermissionSet* and convert to const &.

BUG=455414
[email protected] (misc chrome files with ptr conversion)
[email protected] (extension messages - not actually changing any IPC messages)

Review URL: https://codereview.chromium.org/1349613003

Cr-Commit-Position: refs/heads/master@{#350684}
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 0f976b8..45ab9b6 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1001,7 +1001,7 @@
 
   PermissionIDSet permissions =
       extensions::PermissionMessageProvider::Get()->GetAllPermissionIDs(
-          extension->permissions_data()->active_permissions().get(),
+          extension->permissions_data()->active_permissions(),
           extension->GetType());
   counter_has_any->AddBoolean(!permissions.empty());
   for (const PermissionID& id : permissions)
@@ -1602,7 +1602,7 @@
   if (extension->location() == Manifest::INTERNAL && !auto_grant_permission) {
     // Add all the recognized permissions if the granted permissions list
     // hasn't been initialized yet.
-    scoped_refptr<const PermissionSet> granted_permissions =
+    scoped_ptr<const PermissionSet> granted_permissions =
         extension_prefs_->GetGrantedPermissions(extension->id());
     CHECK(granted_permissions.get());
 
@@ -1613,7 +1613,7 @@
     is_privilege_increase =
         extensions::PermissionMessageProvider::Get()->IsPrivilegeIncrease(
             granted_permissions.get(),
-            extension->permissions_data()->active_permissions().get(),
+            extension->permissions_data()->active_permissions(),
             extension->GetType());
   }
 
@@ -1848,7 +1848,7 @@
   for (const auto& extension : *all_extensions.get()) {
     if (!settings->IsPermissionSetAllowed(
             extension.get(),
-            extension->permissions_data()->active_permissions())) {
+            *extension->permissions_data()->active_permissions())) {
       extensions::PermissionsUpdater(profile()).RemovePermissionsUnsafe(
           extension.get(),
           settings->GetBlockedPermissions(extension.get()).get());