summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'extensions')
-rw-r--r--extensions/common/extensions_client.cc2
-rw-r--r--extensions/common/permissions/api_permission.h3
-rw-r--r--extensions/common/permissions/permission_set.cc1
-rw-r--r--extensions/common/permissions/permissions_info.cc1
4 files changed, 4 insertions, 3 deletions
diff --git a/extensions/common/extensions_client.cc b/extensions/common/extensions_client.cc
index ccca164..89795b8 100644
--- a/extensions/common/extensions_client.cc
+++ b/extensions/common/extensions_client.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/basictypes.h"
+#include "base/logging.h"
#include "extensions/common/extensions_client.h"
namespace extensions {
@@ -14,6 +15,7 @@ ExtensionsClient* g_client = NULL;
} // namespace
ExtensionsClient* ExtensionsClient::Get() {
+ DCHECK(g_client);
return g_client;
}
diff --git a/extensions/common/permissions/api_permission.h b/extensions/common/permissions/api_permission.h
index f50dada..6427e57 100644
--- a/extensions/common/permissions/api_permission.h
+++ b/extensions/common/permissions/api_permission.h
@@ -311,8 +311,7 @@ class APIPermissionInfo {
}
private:
- // Instances should only be constructed from within a
- // PermissionsInfo::Delegate.
+ // Instances should only be constructed from within a PermissionsProvider.
friend class ChromeAPIPermissions;
// Implementations of APIPermission will want to get the permission message,
// but this class's implementation should be hidden from everyone else.
diff --git a/extensions/common/permissions/permission_set.cc b/extensions/common/permissions/permission_set.cc
index 8ec1cbe..fd32d4e 100644
--- a/extensions/common/permissions/permission_set.cc
+++ b/extensions/common/permissions/permission_set.cc
@@ -180,6 +180,7 @@ bool PermissionSet::HasAPIPermission(
bool PermissionSet::HasAPIPermission(const std::string& permission_name) const {
const APIPermissionInfo* permission =
PermissionsInfo::GetInstance()->GetByName(permission_name);
+ // Ensure our PermissionsProvider is aware of this permission.
CHECK(permission) << permission_name;
return (permission && apis_.count(permission->id()));
}
diff --git a/extensions/common/permissions/permissions_info.cc b/extensions/common/permissions/permissions_info.cc
index bac3d9c1..e4684aa 100644
--- a/extensions/common/permissions/permissions_info.cc
+++ b/extensions/common/permissions/permissions_info.cc
@@ -64,7 +64,6 @@ bool PermissionsInfo::HasChildPermissions(const std::string& name) const {
PermissionsInfo::PermissionsInfo()
: hosted_app_permission_count_(0),
permission_count_(0) {
- DCHECK(ExtensionsClient::Get());
InitializeWithProvider(ExtensionsClient::Get()->GetPermissionsProvider());
}