OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 4234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4245 enum AccessType { | 4245 enum AccessType { |
4246 ACCESS_GET, | 4246 ACCESS_GET, |
4247 ACCESS_SET, | 4247 ACCESS_SET, |
4248 ACCESS_HAS, | 4248 ACCESS_HAS, |
4249 ACCESS_DELETE, | 4249 ACCESS_DELETE, |
4250 ACCESS_KEYS | 4250 ACCESS_KEYS |
4251 }; | 4251 }; |
4252 | 4252 |
4253 | 4253 |
4254 /** | 4254 /** |
| 4255 * Returns true if the given context should be allowed to access the given |
| 4256 * object. |
| 4257 */ |
| 4258 typedef bool (*AccessCheckCallback)(Local<Context> accessing_context, |
| 4259 Local<Object> accessed_object); |
| 4260 |
| 4261 |
| 4262 /** |
4255 * Returns true if cross-context access should be allowed to the named | 4263 * Returns true if cross-context access should be allowed to the named |
4256 * property with the given key on the host object. | 4264 * property with the given key on the host object. |
4257 */ | 4265 */ |
4258 typedef bool (*NamedSecurityCallback)(Local<Object> host, | 4266 typedef bool (*NamedSecurityCallback)(Local<Object> host, |
4259 Local<Value> key, | 4267 Local<Value> key, |
4260 AccessType type, | 4268 AccessType type, |
4261 Local<Value> data); | 4269 Local<Value> data); |
4262 | 4270 |
4263 | 4271 |
4264 /** | 4272 /** |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4652 * Mark object instances of the template as undetectable. | 4660 * Mark object instances of the template as undetectable. |
4653 * | 4661 * |
4654 * In many ways, undetectable objects behave as though they are not | 4662 * In many ways, undetectable objects behave as though they are not |
4655 * there. They behave like 'undefined' in conditionals and when | 4663 * there. They behave like 'undefined' in conditionals and when |
4656 * printed. However, properties can be accessed and called as on | 4664 * printed. However, properties can be accessed and called as on |
4657 * normal objects. | 4665 * normal objects. |
4658 */ | 4666 */ |
4659 void MarkAsUndetectable(); | 4667 void MarkAsUndetectable(); |
4660 | 4668 |
4661 /** | 4669 /** |
4662 * Sets access check callbacks on the object template and enables | 4670 * Sets access check callback on the object template and enables access |
4663 * access checks. | 4671 * checks. |
4664 * | 4672 * |
4665 * When accessing properties on instances of this object template, | 4673 * When accessing properties on instances of this object template, |
4666 * the access check callback will be called to determine whether or | 4674 * the access check callback will be called to determine whether or |
4667 * not to allow cross-context access to the properties. | 4675 * not to allow cross-context access to the properties. |
4668 */ | 4676 */ |
4669 void SetAccessCheckCallbacks(NamedSecurityCallback named_handler, | 4677 void SetAccessCheckCallback(AccessCheckCallback callback); |
4670 IndexedSecurityCallback indexed_handler, | 4678 |
4671 Local<Value> data = Local<Value>()); | 4679 V8_DEPRECATE_SOON( |
| 4680 "Use SetAccessCheckCallback instead", |
| 4681 void SetAccessCheckCallbacks(NamedSecurityCallback named_handler, |
| 4682 IndexedSecurityCallback indexed_handler, |
| 4683 Local<Value> data = Local<Value>())); |
4672 | 4684 |
4673 /** | 4685 /** |
4674 * Gets the number of internal fields for objects generated from | 4686 * Gets the number of internal fields for objects generated from |
4675 * this template. | 4687 * this template. |
4676 */ | 4688 */ |
4677 int InternalFieldCount(); | 4689 int InternalFieldCount(); |
4678 | 4690 |
4679 /** | 4691 /** |
4680 * Sets the number of internal fields for objects generated from | 4692 * Sets the number of internal fields for objects generated from |
4681 * this template. | 4693 * this template. |
(...skipping 3714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8396 */ | 8408 */ |
8397 | 8409 |
8398 | 8410 |
8399 } // namespace v8 | 8411 } // namespace v8 |
8400 | 8412 |
8401 | 8413 |
8402 #undef TYPE_CHECK | 8414 #undef TYPE_CHECK |
8403 | 8415 |
8404 | 8416 |
8405 #endif // V8_H_ | 8417 #endif // V8_H_ |
OLD | NEW |