| Index: mojo/public/cpp/bindings/interface_endpoint_client.h
|
| diff --git a/mojo/public/cpp/bindings/interface_endpoint_client.h b/mojo/public/cpp/bindings/interface_endpoint_client.h
|
| index 4a24a31f8b18f802564bb103ba8f7a2f9ace4dfc..4cdb97f1c14965dee137cb23934899a7536e0419 100644
|
| --- a/mojo/public/cpp/bindings/interface_endpoint_client.h
|
| +++ b/mojo/public/cpp/bindings/interface_endpoint_client.h
|
| @@ -15,6 +15,7 @@
|
| #include "base/macros.h"
|
| #include "base/memory/ref_counted.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "base/message_loop/message_loop.h"
|
| #include "base/single_thread_task_runner.h"
|
| #include "base/threading/thread_checker.h"
|
| #include "mojo/public/cpp/bindings/connection_error_callback.h"
|
| @@ -33,7 +34,8 @@ class InterfaceEndpointController;
|
| // InterfaceEndpointClient handles message sending and receiving of an interface
|
| // endpoint, either the implementation side or the client side.
|
| // It should only be accessed and destructed on the creating thread.
|
| -class InterfaceEndpointClient : public MessageReceiverWithResponder {
|
| +class InterfaceEndpointClient : public MessageReceiverWithResponder,
|
| + public base::MessageLoop::DestructionObserver {
|
| public:
|
| // |receiver| is okay to be null. If it is not null, it must outlive this
|
| // object.
|
| @@ -144,6 +146,10 @@ class InterfaceEndpointClient : public MessageReceiverWithResponder {
|
| };
|
|
|
| bool HandleValidatedMessage(Message* message);
|
| + void StopObservingIfNecessary();
|
| +
|
| + // base::MessageLoop::DestructionObserver:
|
| + void WillDestroyCurrentMessageLoop() override;
|
|
|
| ScopedInterfaceEndpointHandle handle_;
|
| std::unique_ptr<AssociatedGroup> associated_group_;
|
| @@ -167,6 +173,8 @@ class InterfaceEndpointClient : public MessageReceiverWithResponder {
|
| internal::ControlMessageProxy control_message_proxy_;
|
| internal::ControlMessageHandler control_message_handler_;
|
|
|
| + bool observing_message_loop_destruction_ = true;
|
| +
|
| base::ThreadChecker thread_checker_;
|
|
|
| base::WeakPtrFactory<InterfaceEndpointClient> weak_ptr_factory_;
|
|
|