Commit e2675937 authored by jochen's avatar jochen Committed by Commit bot

Add optional data parameter to SetAccessCheckCallback

The data field is passed to the failed access check callback which blink
depends on.

BUG=none
R=verwaest@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1427443002

Cr-Commit-Position: refs/heads/master@{#31555}
parent d5a91e3d
......@@ -4674,7 +4674,8 @@ class V8_EXPORT ObjectTemplate : public Template {
* the access check callback will be called to determine whether or
* not to allow cross-context access to the properties.
*/
void SetAccessCheckCallback(AccessCheckCallback callback);
void SetAccessCheckCallback(AccessCheckCallback callback,
Local<Value> data = Local<Value>());
V8_DEPRECATE_SOON(
"Use SetAccessCheckCallback instead",
......
......@@ -1452,7 +1452,8 @@ void ObjectTemplate::MarkAsUndetectable() {
}
void ObjectTemplate::SetAccessCheckCallback(AccessCheckCallback callback) {
void ObjectTemplate::SetAccessCheckCallback(AccessCheckCallback callback,
Local<Value> data) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
i::HandleScope scope(isolate);
......@@ -1468,7 +1469,10 @@ void ObjectTemplate::SetAccessCheckCallback(AccessCheckCallback callback) {
SET_FIELD_WRAPPED(info, set_named_callback, nullptr);
SET_FIELD_WRAPPED(info, set_indexed_callback, nullptr);
info->set_data(*isolate->factory()->undefined_value());
if (data.IsEmpty()) {
data = v8::Undefined(reinterpret_cast<v8::Isolate*>(isolate));
}
info->set_data(*Utils::OpenHandle(*data));
cons->set_access_check_info(*info);
cons->set_needs_access_check(true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment