mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: MessagePort closing unexpectedly with non-cloneable objects (#42580)
* fix: MessagePort closing unexpectedly with non-cloneable objects Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> * fix: handle serialization failure in parentPort Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -44,7 +44,13 @@ void ParentPort::PostMessage(v8::Local<v8::Value> message_value) {
|
||||
if (!connector_closed_ && connector_ && connector_->is_valid()) {
|
||||
v8::Isolate* isolate = JavascriptEnvironment::GetIsolate();
|
||||
blink::TransferableMessage transferable_message;
|
||||
electron::SerializeV8Value(isolate, message_value, &transferable_message);
|
||||
|
||||
if (!electron::SerializeV8Value(isolate, message_value,
|
||||
&transferable_message)) {
|
||||
// SerializeV8Value sets an exception.
|
||||
return;
|
||||
}
|
||||
|
||||
mojo::Message mojo_message =
|
||||
blink::mojom::TransferableMessage::WrapAsMessage(
|
||||
std::move(transferable_message));
|
||||
|
||||
Reference in New Issue
Block a user