Browse Source

refactor: use private inheritance from `mojo::MessageReceiver` (#45994)

* refactor: make UtilityProcessWrapper inherit privately from mojo::MessageReceiver

Co-authored-by: Charles Kerr <[email protected]>

* refactor: make ParentPort inherit privately from mojo::MessageReceiver

Co-authored-by: Charles Kerr <[email protected]>

* refactor: make MessagePort inherit privately from mojo::MessageReceiver

Co-authored-by: Charles Kerr <[email protected]>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <[email protected]>
trop[bot] 1 month ago
parent
commit
974c8f5150

+ 1 - 1
shell/browser/api/electron_api_utility_process.h

@@ -43,7 +43,7 @@ class UtilityProcessWrapper final
     : public gin::Wrappable<UtilityProcessWrapper>,
       public gin_helper::Pinnable<UtilityProcessWrapper>,
       public gin_helper::EventEmitterMixin<UtilityProcessWrapper>,
-      public mojo::MessageReceiver,
+      private mojo::MessageReceiver,
       public node::mojom::NodeServiceClient,
       public content::ServiceProcessHost::Observer {
  public:

+ 1 - 1
shell/browser/api/message_port.h

@@ -29,7 +29,7 @@ namespace electron {
 // A non-blink version of blink::MessagePort.
 class MessagePort final : public gin::Wrappable<MessagePort>,
                           public gin_helper::CleanedUpAtExit,
-                          public mojo::MessageReceiver {
+                          private mojo::MessageReceiver {
  public:
   ~MessagePort() override;
   static gin::Handle<MessagePort> Create(v8::Isolate* isolate);

+ 1 - 1
shell/services/node/parent_port.h

@@ -31,7 +31,7 @@ namespace electron {
 // for the lifetime of a Utility Process which
 // also means that GC lifecycle is ignored by this class.
 class ParentPort final : public gin::Wrappable<ParentPort>,
-                         public mojo::MessageReceiver {
+                         private mojo::MessageReceiver {
  public:
   static ParentPort* GetInstance();
   static gin::Handle<ParentPort> Create(v8::Isolate* isolate);