feat: MessagePorts in the main process (#22404)
This commit is contained in:
parent
c4c0888972
commit
b4d07f76d3
34 changed files with 1316 additions and 113 deletions
|
@ -37,7 +37,7 @@ v8::Persistent<v8::FunctionTemplate> g_call_translater;
|
|||
void CallTranslater(v8::Local<v8::External> external,
|
||||
v8::Local<v8::Object> state,
|
||||
gin::Arguments* args) {
|
||||
// Whether the callback should only be called for once.
|
||||
// Whether the callback should only be called once.
|
||||
v8::Isolate* isolate = args->isolate();
|
||||
auto context = isolate->GetCurrentContext();
|
||||
bool one_time =
|
||||
|
@ -47,7 +47,7 @@ void CallTranslater(v8::Local<v8::External> external,
|
|||
if (one_time) {
|
||||
auto called_symbol = gin::StringToSymbol(isolate, "called");
|
||||
if (state->Has(context, called_symbol).ToChecked()) {
|
||||
args->ThrowTypeError("callback can only be called for once");
|
||||
args->ThrowTypeError("One-time callback was called more than once");
|
||||
return;
|
||||
} else {
|
||||
state->Set(context, called_symbol, v8::Boolean::New(isolate, true))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue