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

Unified Diff: include/v8.h

Issue 1410883006: Plumb accessing context through to access control callbacks (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index d7e58028798d481ad3b3bb79c896e7d5eb269566..ee9d12e3be915fadd6302eadc920561a2668034f 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -4252,6 +4252,14 @@ enum AccessType {
/**
+ * Returns true if the given context should be allowed to access the given
+ * object.
+ */
+typedef bool (*AccessCheckCallback)(Local<Context> accessing_context,
+ Local<Object> accessed_object);
+
+
+/**
* Returns true if cross-context access should be allowed to the named
* property with the given key on the host object.
*/
@@ -4659,16 +4667,20 @@ class V8_EXPORT ObjectTemplate : public Template {
void MarkAsUndetectable();
/**
- * Sets access check callbacks on the object template and enables
- * access checks.
+ * Sets access check callback on the object template and enables access
+ * checks.
*
* When accessing properties on instances of this object template,
* the access check callback will be called to determine whether or
* not to allow cross-context access to the properties.
*/
- void SetAccessCheckCallbacks(NamedSecurityCallback named_handler,
- IndexedSecurityCallback indexed_handler,
- Local<Value> data = Local<Value>());
+ void SetAccessCheckCallback(AccessCheckCallback callback);
+
+ V8_DEPRECATE_SOON(
+ "Use SetAccessCheckCallback instead",
+ void SetAccessCheckCallbacks(NamedSecurityCallback named_handler,
+ IndexedSecurityCallback indexed_handler,
+ Local<Value> data = Local<Value>()));
/**
* Gets the number of internal fields for objects generated from
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698