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

Side by Side Diff: mojo/public/cpp/bindings/connection_error_callback.h

Issue 2932193002: Use OnceCallback for Mojo binding connection error handlers. (Closed)
Patch Set: Call Run() on rvalue. Created 3 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 unified diff | Download patch
« no previous file with comments | « mojo/public/cpp/bindings/binding_set.h ('k') | mojo/public/cpp/bindings/connector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 11
12 // This callback type accepts user-defined disconnect reason and description. If 12 // These callback types accept user-defined disconnect reason and description.
13 // the other side specifies a reason on closing the connection, it will be 13 // If the other side specifies a reason on closing the connection, it will be
14 // passed to the error handler. 14 // passed to the error handler.
15 using ConnectionErrorWithReasonCallback = 15 using ConnectionErrorWithReasonCallback =
16 base::Callback<void(uint32_t /* custom_reason */, 16 base::OnceCallback<void(uint32_t /* custom_reason */,
17 const std::string& /* description */)>; 17 const std::string& /* description */)>;
18 using RepeatingConnectionErrorWithReasonCallback =
19 base::RepeatingCallback<void(uint32_t /* custom_reason */,
20 const std::string& /* description */)>;
18 21
19 } // namespace mojo 22 } // namespace mojo
20 23
21 #endif // MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_ 24 #endif // MOJO_PUBLIC_CPP_BINDINGS_CONNECTION_ERROR_CALLBACK_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/binding_set.h ('k') | mojo/public/cpp/bindings/connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698