Chromium Code Reviews| Index: chrome/common/extensions/api/extension_api.h |
| diff --git a/chrome/common/extensions/api/extension_api.h b/chrome/common/extensions/api/extension_api.h |
| index cd97f448f321d622d818efd64c98dc4a8c16d1cc..5c44b97e9b3423190f7b49b0043fe11a2c2d7dd8 100644 |
| --- a/chrome/common/extensions/api/extension_api.h |
| +++ b/chrome/common/extensions/api/extension_api.h |
| @@ -7,6 +7,7 @@ |
| #pragma once |
| #include <map> |
| +#include <set> |
| #include <string> |
| #include "base/basictypes.h" |
| @@ -33,12 +34,17 @@ class ExtensionAPI { |
| // Returns the single instance of this class. |
| static ExtensionAPI* GetInstance(); |
| - // Returns ture if |name| is a privileged API. Privileged APIs can only be |
| - // called from extension code which is running in its own designated extension |
| - // process. They cannot be called from extension code running in content |
| - // scripts, or other low-privileged processes. |
| + // Returns true if |name| is a privileged API path. Privileged paths can only |
| + // be called from extension code which is running in its own designated |
| + // extension process. They cannot be called from extension code running in |
| + // content scripts, or other low-privileged processes. |
|
Aaron Boodman
2012/02/16 00:17:13
nit: last word would be better as "contexts".
not at google - send to devlin
2012/02/16 01:45:53
Done.
|
| bool IsPrivileged(const std::string& name) const; |
| + // Gets whether *every* path in the API is privileged. This will be false for |
|
koz (OOO until 15th September)
2012/02/15 23:43:11
nit: "Gets whether" -> "Returns whether"
not at google - send to devlin
2012/02/16 00:06:27
Done.
|
| + // APIs such as "storage" which is entirely unprivileged, and "test" which |
| + // has unprivileged components. |
| + bool IsWholeAPIPrivileged(const std::string& api_name) const; |
| + |
| // Gets a map of API name (aka namespace) to API schema. |
| const SchemaMap& schemas() { return schemas_; } |
| @@ -88,6 +94,12 @@ class ExtensionAPI { |
| // Schemas for each namespace. |
| SchemaMap schemas_; |
| + // APIs that are entirely unprivileged. |
| + std::set<std::string> completely_unprivileged_apis_; |
| + |
| + // APIs that are not entirely unprivileged, but have unprivileged components. |
| + std::set<std::string> partially_unprivileged_apis_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); |
| }; |