Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1674)

Unified Diff: mojo/public/cpp/bindings/lib/interface_endpoint_client.cc

Issue 2633053002: Remove the MessageLoop::DestructionObserver from mojo bindings. (Closed)
Patch Set: rebase Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
diff --git a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
index db34291a5363d7ecaff2bea57fad011873b2e146..a9eee86b6aa27ec93664b1937875287e68996ef2 100644
--- a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
+++ b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
@@ -159,15 +159,11 @@ InterfaceEndpointClient::InterfaceEndpointClient(
handle_, this, task_runner_);
if (expect_sync_requests)
controller_->AllowWokenUpBySyncWatchOnSameThread();
-
- base::MessageLoop::current()->AddDestructionObserver(this);
}
InterfaceEndpointClient::~InterfaceEndpointClient() {
DCHECK(thread_checker_.CalledOnValidThread());
- StopObservingIfNecessary();
-
if (handle_.is_valid())
handle_.group_controller()->DetachEndpointClient(handle_);
}
@@ -351,17 +347,4 @@ bool InterfaceEndpointClient::HandleValidatedMessage(Message* message) {
}
}
-void InterfaceEndpointClient::StopObservingIfNecessary() {
- if (!observing_message_loop_destruction_)
- return;
-
- observing_message_loop_destruction_ = false;
- base::MessageLoop::current()->RemoveDestructionObserver(this);
-}
-
-void InterfaceEndpointClient::WillDestroyCurrentMessageLoop() {
- StopObservingIfNecessary();
- NotifyError(base::nullopt);
-}
-
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/interface_endpoint_client.h ('k') | mojo/public/cpp/bindings/strong_associated_binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698