Skip to content

Commit 1afbecd

Browse files
committed
Expose v8::Context::SetSecurityToken
As well as the other Security Token helpers. Needed for better frame support.
1 parent 6f346eb commit 1afbecd

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/binding.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,19 @@ const v8::Data* v8__Context__GetDataFromSnapshotOnce(v8::Context *self, size_t i
643643
return local_to_ptr(maybe.ToLocalChecked());
644644
}
645645

646+
void v8__Context__SetSecurityToken(
647+
const v8::Context& self,
648+
const v8::Value& val) {
649+
ptr_to_local(&self)->SetSecurityToken(ptr_to_local(&val));
650+
}
651+
void v8__Context__UseDefaultSecurityToken(
652+
const v8::Context& self) {
653+
ptr_to_local(&self)->UseDefaultSecurityToken();
654+
}
655+
const v8::Value* v8__Context__GetSecurityToken(
656+
const v8::Context& self) {
657+
return local_to_ptr(ptr_to_local(&self)->GetSecurityToken());
658+
}
646659
// ScriptOrigin
647660

648661
void v8__ScriptOrigin__CONSTRUCT(

src/binding.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,10 @@ void v8__Context__SetAlignedPointerInEmbedderData(
478478
int v8__Context__DebugContextId(const Context* self);
479479
const Data* v8__Context__GetDataFromSnapshotOnce(const Context *self, size_t idx);
480480

481+
void v8__Context__SetSecurityToken(const Context* self, const Value* val);
482+
void v8__Context__UseDefaultSecurityToken(const Context* self);
483+
const Value* v8__Context__GetSecurityToken(const Context* self);
484+
481485
// Boolean
482486
const Boolean* v8__Boolean__New(
483487
Isolate* isolate,

0 commit comments

Comments
 (0)