Lines Matching refs:MessagePort

87 // `MessagePort`s and `SharedArrayBuffer`s, and make new JS objects out of them.
155 // Create all necessary objects for transferables, e.g. MessagePort handles.
494 // Check if the source MessagePort is being transferred.
506 static_cast<MessagePort*>(host_object.get())->IsDetached())) {
511 "MessagePort in transfer list is already detached"));
569 MessagePortData::MessagePortData(MessagePort* owner)
605 MessagePort::~MessagePort() {
609 MessagePort::MessagePort(Environment* env,
619 MessagePort* channel = ContainerOf(&MessagePort::async_, handle);
649 bool MessagePort::IsDetached() const {
653 void MessagePort::TriggerAsync() {
658 void MessagePort::Close(v8::Local<v8::Value> close_callback) {
671 void MessagePort::New(const FunctionCallbackInfo<Value>& args) {
679 MessagePort* MessagePort::New(
692 MessagePort* port = new MessagePort(env, context, instance);
718 MaybeLocal<Value> MessagePort::ReceiveMessage(Local<Context> context,
726 Debug(this, "MessagePort has message");
755 void MessagePort::OnMessage(MessageProcessingMode mode) {
756 Debug(this, "Running MessagePort::OnMessage()");
809 Debug(this, "MessagePort drains queue because !can_call_into_js()");
835 void MessagePort::OnClose() {
836 Debug(this, "MessagePort::OnClose()");
843 std::unique_ptr<MessagePortData> MessagePort::Detach() {
850 BaseObject::TransferMode MessagePort::GetTransferMode() const {
856 std::unique_ptr<TransferData> MessagePort::TransferForMessaging() {
865 return BaseObjectPtr<MessagePort> { MessagePort::New(
870 Maybe<bool> MessagePort::PostMessage(Environment* env,
880 // serialize the input message, even if the MessagePort is closed or detached.
970 void MessagePort::PostMessage(const FunctionCallbackInfo<Value>& args) {
977 "MessagePort.postMessage");
1007 MessagePort* port = Unwrap<MessagePort>(args.This());
1008 // Even if the backing MessagePort object has already been deleted, we still
1022 void MessagePort::Start() {
1030 void MessagePort::Stop() {
1035 void MessagePort::Start(const FunctionCallbackInfo<Value>& args) {
1036 MessagePort* port;
1044 void MessagePort::Stop(const FunctionCallbackInfo<Value>& args) {
1045 MessagePort* port;
1054 void MessagePort::CheckType(const FunctionCallbackInfo<Value>& args) {
1060 void MessagePort::Drain(const FunctionCallbackInfo<Value>& args) {
1061 MessagePort* port;
1066 void MessagePort::ReceiveMessage(const FunctionCallbackInfo<Value>& args) {
1071 "The \"port\" argument must be a MessagePort instance");
1073 MessagePort* port = Unwrap<MessagePort>(args[0].As<Object>());
1088 void MessagePort::MoveToContext(const FunctionCallbackInfo<Value>& args) {
1093 "The \"port\" argument must be a MessagePort instance");
1095 MessagePort* port = Unwrap<MessagePort>(args[0].As<Object>());
1115 MessagePort* target =
1116 MessagePort::New(env, context_wrapper->context(), std::move(data));
1121 void MessagePort::Entangle(MessagePort* a, MessagePort* b) {
1125 void MessagePort::Entangle(MessagePort* a, MessagePortData* b) {
1129 void MessagePort::MemoryInfo(MemoryTracker* tracker) const {
1135 // Factor generating the MessagePort JS constructor into its own piece
1143 Local<FunctionTemplate> m = NewFunctionTemplate(isolate, MessagePort::New);
1146 MessagePort::kInternalFieldCount);
1149 SetProtoMethod(isolate, m, "postMessage", MessagePort::PostMessage);
1150 SetProtoMethod(isolate, m, "start", MessagePort::Start);
1368 *error = "Source MessagePort is not entangled with this group.";
1450 MessagePort* port1 = MessagePort::New(env, context);
1452 MessagePort* port2 = MessagePort::New(env, context);
1458 MessagePort::Entangle(port1, port2);
1471 MessagePort* port =
1472 MessagePort::New(env, env->context(), {}, SiblingGroup::Get(*name));
1509 // These are not methods on the MessagePort prototype, because
1511 SetMethod(context, target, "stopMessagePort", MessagePort::Stop);
1512 SetMethod(context, target, "checkMessagePort", MessagePort::CheckType);
1513 SetMethod(context, target, "drainMessagePort", MessagePort::Drain);
1515 context, target, "receiveMessageOnPort", MessagePort::ReceiveMessage);
1517 context, target, "moveMessagePortToContext", MessagePort::MoveToContext);
1538 registry->Register(MessagePort::New);
1539 registry->Register(MessagePort::PostMessage);
1540 registry->Register(MessagePort::Start);
1541 registry->Register(MessagePort::Stop);
1542 registry->Register(MessagePort::CheckType);
1543 registry->Register(MessagePort::Drain);
1544 registry->Register(MessagePort::ReceiveMessage);
1545 registry->Register(MessagePort::MoveToContext);