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

Unified Diff: chrome/common/extensions/api/extension_api.h

Issue 9403006: Extensions: run "custom bindings" v8-extensions in content scripts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 10 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/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);
};
« no previous file with comments | « no previous file | chrome/common/extensions/api/extension_api.cc » ('j') | chrome/common/extensions/api/extension_api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698