blob: 0e0cad6032f6d8e19d425431f8c35e44a0b11ebc [file] [log] [blame]
Avi Drissmand387f0922022-09-14 20:51:311// Copyright 2016 The Chromium Authors
yzshen24438d22016-09-13 17:03:532// 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 Drissmand70f89a2023-01-11 23:52:558#include "base/functional/callback.h"
yzshen24438d22016-09-13 17:03:539
10namespace mojo {
11
jameswest14ae0132017-06-12 22:52:0012// 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
yzshen24438d22016-09-13 17:03:5314// passed to the error handler.
15using ConnectionErrorWithReasonCallback =
jameswest14ae0132017-06-12 22:52:0016 base::OnceCallback<void(uint32_t /* custom_reason */,
17 const std::string& /* description */)>;
18using RepeatingConnectionErrorWithReasonCallback =
19 base::RepeatingCallback<void(uint32_t /* custom_reason */,
20 const std::string& /* description */)>;
yzshen24438d22016-09-13 17:03:5321
22} // namespace mojo
23
24#endif // MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_