aboutsummaryrefslogtreecommitdiff
path: root/mojo/public/cpp/bindings/connection_error_callback.h
blob: 306e99e45b3462478b759afba74fb794dfa75dc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_
#define MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_

#include "base/callback.h"

namespace mojo {

// This callback type accepts user-defined disconnect reason and description. If
// the other side specifies a reason on closing the connection, it will be
// passed to the error handler.
using ConnectionErrorWithReasonCallback =
    base::Callback<void(uint32_t /* custom_reason */,
                        const std::string& /* description */)>;

}  // namespace mojo

#endif  // MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_