Avi Drissman | d387f092 | 2022-09-14 20:51:31 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors |
yzshen | 24438d2 | 2016-09-13 17:03:53 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_ |
| 6 | #define MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_ |
| 7 | |
Avi Drissman | d70f89a | 2023-01-11 23:52:55 | [diff] [blame] | 8 | #include "base/functional/callback.h" |
yzshen | 24438d2 | 2016-09-13 17:03:53 | [diff] [blame] | 9 | |
| 10 | namespace mojo { |
| 11 | |
jameswest | 14ae013 | 2017-06-12 22:52:00 | [diff] [blame] | 12 | // These callback types accept user-defined disconnect reason and description. |
| 13 | // If the other side specifies a reason on closing the connection, it will be |
yzshen | 24438d2 | 2016-09-13 17:03:53 | [diff] [blame] | 14 | // passed to the error handler. |
| 15 | using ConnectionErrorWithReasonCallback = |
jameswest | 14ae013 | 2017-06-12 22:52:00 | [diff] [blame] | 16 | base::OnceCallback<void(uint32_t /* custom_reason */, |
| 17 | const std::string& /* description */)>; |
| 18 | using RepeatingConnectionErrorWithReasonCallback = |
| 19 | base::RepeatingCallback<void(uint32_t /* custom_reason */, |
| 20 | const std::string& /* description */)>; |
yzshen | 24438d2 | 2016-09-13 17:03:53 | [diff] [blame] | 21 | |
| 22 | } // namespace mojo |
| 23 | |
| 24 | #endif // MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_ |