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

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: final comments 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
« no previous file with comments | « no previous file | chrome/common/extensions/api/extension_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4ba7c209b6d0768bb8ea70cc58d2bbda1465347f 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 contexts.
bool IsPrivileged(const std::string& name) const;
+ // Returns whether *every* path in the API is privileged. This will be false
+ // for 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698