| Index: mojo/public/cpp/bindings/binding_set.h
|
| diff --git a/mojo/public/cpp/bindings/binding_set.h b/mojo/public/cpp/bindings/binding_set.h
|
| index 84b6c64cb67435659d40a467440f451cc65cec4a..c66183923aabc667aed90e4ea14bc3ff64322f4c 100644
|
| --- a/mojo/public/cpp/bindings/binding_set.h
|
| +++ b/mojo/public/cpp/bindings/binding_set.h
|
| @@ -73,14 +73,14 @@ class BindingSetBase {
|
|
|
| BindingSetBase() {}
|
|
|
| - void set_connection_error_handler(const base::Closure& error_handler) {
|
| - error_handler_ = error_handler;
|
| + void set_connection_error_handler(base::RepeatingClosure error_handler) {
|
| + error_handler_ = std::move(error_handler);
|
| error_with_reason_handler_.Reset();
|
| }
|
|
|
| void set_connection_error_with_reason_handler(
|
| - const ConnectionErrorWithReasonCallback& error_handler) {
|
| - error_with_reason_handler_ = error_handler;
|
| + RepeatingConnectionErrorWithReasonCallback error_handler) {
|
| + error_with_reason_handler_ = std::move(error_handler);
|
| error_handler_.Reset();
|
| }
|
|
|
| @@ -182,7 +182,7 @@ class BindingSetBase {
|
| if (ContextTraits::SupportsContext())
|
| binding_.AddFilter(base::MakeUnique<DispatchFilter>(this));
|
| binding_.set_connection_error_with_reason_handler(
|
| - base::Bind(&Entry::OnConnectionError, base::Unretained(this)));
|
| + base::BindOnce(&Entry::OnConnectionError, base::Unretained(this)));
|
| }
|
|
|
| void FlushForTesting() { binding_.FlushForTesting(); }
|
| @@ -254,14 +254,15 @@ class BindingSetBase {
|
| if (!is_flushing_)
|
| bindings_.erase(it);
|
|
|
| - if (!error_handler_.is_null())
|
| + if (error_handler_) {
|
| error_handler_.Run();
|
| - else if (!error_with_reason_handler_.is_null())
|
| + } else if (error_with_reason_handler_) {
|
| error_with_reason_handler_.Run(custom_reason, description);
|
| + }
|
| }
|
|
|
| - base::Closure error_handler_;
|
| - ConnectionErrorWithReasonCallback error_with_reason_handler_;
|
| + base::RepeatingClosure error_handler_;
|
| + RepeatingConnectionErrorWithReasonCallback error_with_reason_handler_;
|
| PreDispatchCallback pre_dispatch_handler_;
|
| BindingId next_binding_id_ = 0;
|
| std::map<BindingId, std::unique_ptr<Entry>> bindings_;
|
|
|