fix: destroy message port backend when JS env exits (#39335)

This commit is contained in:
Robo 2023-08-03 21:30:19 +09:00 committed by GitHub
parent fe93f69e5a
commit e96b1613a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@
#include "gin/wrappable.h" #include "gin/wrappable.h"
#include "mojo/public/cpp/bindings/connector.h" #include "mojo/public/cpp/bindings/connector.h"
#include "mojo/public/cpp/bindings/message.h" #include "mojo/public/cpp/bindings/message.h"
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
#include "third_party/blink/public/common/messaging/message_port_channel.h" #include "third_party/blink/public/common/messaging/message_port_channel.h"
#include "third_party/blink/public/common/messaging/message_port_descriptor.h" #include "third_party/blink/public/common/messaging/message_port_descriptor.h"
@ -23,7 +24,9 @@ class Handle;
namespace electron { namespace electron {
// A non-blink version of blink::MessagePort. // A non-blink version of blink::MessagePort.
class MessagePort : public gin::Wrappable<MessagePort>, mojo::MessageReceiver { class MessagePort : public gin::Wrappable<MessagePort>,
public gin_helper::CleanedUpAtExit,
public mojo::MessageReceiver {
public: public:
~MessagePort() override; ~MessagePort() override;
static gin::Handle<MessagePort> Create(v8::Isolate* isolate); static gin::Handle<MessagePort> Create(v8::Isolate* isolate);