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

Unified Diff: mojo/public/cpp/bindings/interface_ptr_set.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/callback.h ('k') | mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/interface_ptr_set.h
diff --git a/mojo/public/cpp/bindings/interface_ptr_set.h b/mojo/public/cpp/bindings/interface_ptr_set.h
index 69fc8249cd40c3f6dc756792ea92a8b49ca2b6c4..d4b2046f5b1842157489bf02923625ac4dd7dfd8 100644
--- a/mojo/public/cpp/bindings/interface_ptr_set.h
+++ b/mojo/public/cpp/bindings/interface_ptr_set.h
@@ -50,8 +50,9 @@ class PtrSet {
public:
explicit Element(Ptr<Interface> ptr)
: ptr_(std::move(ptr)), weak_ptr_factory_(this) {
- ptr_.set_connection_error_handler([this]() { delete this; });
+ ptr_.set_connection_error_handler(base::Bind(&DeleteElement, this));
}
+
~Element() {}
void Close() { ptr_.reset(); }
@@ -63,6 +64,8 @@ class PtrSet {
}
private:
+ static void DeleteElement(Element* element) { delete element; }
+
Ptr<Interface> ptr_;
base::WeakPtrFactory<Element> weak_ptr_factory_;
« no previous file with comments | « mojo/public/cpp/bindings/callback.h ('k') | mojo/public/cpp/bindings/lib/associated_interface_ptr_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698