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

Unified Diff: mojo/public/cpp/bindings/associated_binding.h

Issue 2062333002: mojo::Callback -> base::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/binding_set.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/associated_binding.h
diff --git a/mojo/public/cpp/bindings/associated_binding.h b/mojo/public/cpp/bindings/associated_binding.h
index 2d4e3392230bc936a18978e692f8c6c49b925014..495bce8fae0b889ccd66c8f50e8b3e9a5d9c22d4 100644
--- a/mojo/public/cpp/bindings/associated_binding.h
+++ b/mojo/public/cpp/bindings/associated_binding.h
@@ -8,6 +8,7 @@
#include <memory>
#include <utility>
+#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
@@ -102,7 +103,8 @@ class AssociatedBinding {
base::WrapUnique(new typename Interface::RequestValidator_()),
Interface::HasSyncMethods_, std::move(runner)));
endpoint_client_->set_connection_error_handler(
- [this]() { connection_error_handler_.Run(); });
+ base::Bind(&AssociatedBinding::RunConnectionErrorHandler,
+ base::Unretained(this)));
stub_.serialization_context()->router = endpoint_client_->router();
}
@@ -112,7 +114,7 @@ class AssociatedBinding {
void Close() {
DCHECK(endpoint_client_);
endpoint_client_.reset();
- connection_error_handler_.reset();
+ connection_error_handler_.Reset();
}
// Unbinds and returns the associated interface request so it can be
@@ -125,7 +127,7 @@ class AssociatedBinding {
request.Bind(endpoint_client_->PassHandle());
endpoint_client_.reset();
- connection_error_handler_.reset();
+ connection_error_handler_.Reset();
return request;
}
@@ -153,6 +155,11 @@ class AssociatedBinding {
}
private:
+ void RunConnectionErrorHandler() {
+ if (!connection_error_handler_.is_null())
+ connection_error_handler_.Run();
+ }
+
std::unique_ptr<internal::InterfaceEndpointClient> endpoint_client_;
typename Interface::Stub_ stub_;
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/binding_set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698