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

Unified Diff: extensions/renderer/script_context.h

Issue 789063002: Implement clipboardRead/Write content capabilities (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: extensions/renderer/script_context.h
diff --git a/extensions/renderer/script_context.h b/extensions/renderer/script_context.h
index af7fb1f60d999f110bb0d18e033536c387c791f0..d4e30ed5c50e9162132de53d87aa26326b9f8b86 100644
--- a/extensions/renderer/script_context.h
+++ b/extensions/renderer/script_context.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "extensions/common/features/feature.h"
+#include "extensions/common/permissions/api_permission_set.h"
#include "extensions/renderer/module_system.h"
#include "extensions/renderer/request_sender.h"
#include "extensions/renderer/safe_builtins.h"
@@ -150,6 +151,15 @@ class ScriptContext : public RequestSender::Source, public gin::Runner {
v8::Handle<v8::Value> argv[]) override;
gin::ContextHolder* GetContextHolder() override;
+ // Grants a set of content capabilities to this context.
+ void SetContentCapabilities(const APIPermissionSet& permissions);
+
+ // Indicates if this context has an effective API permission either by being
+ // a context for an extension which has that permission, or by being a web
+ // context which has been granted the corresponding capability by an
+ // extension.
+ bool HasEffectiveAPIPermission(APIPermission::ID permission) const;
not at google - send to devlin 2014/12/10 17:33:54 What is "Effective" about this? Ideally we'd call
Ken Rockot(use gerrit already) 2014/12/10 18:31:41 Heh, that's what it was and then I changed it most
+
protected:
// The v8 context the bindings are accessible to.
ScopedPersistent<v8::Context> v8_context_;
@@ -180,6 +190,9 @@ class ScriptContext : public RequestSender::Source, public gin::Runner {
// Contains safe copies of builtin objects like Function.prototype.
SafeBuiltins safe_builtins_;
+ // The set of capabilities granted to this context by extensions.
+ APIPermissionSet content_capabilities_;
+
v8::Isolate* isolate_;
GURL url_;

Powered by Google App Engine
This is Rietveld 408576698