Avi Drissman | 6459548 | 2022-09-14 20:52:29 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors |
Matt Menke | dadd6c7 | 2018-01-30 23:07:25 | [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 NET_BASE_COMPLETION_ONCE_CALLBACK_H_ |
| 6 | #define NET_BASE_COMPLETION_ONCE_CALLBACK_H_ |
| 7 | |
| 8 | #include <stdint.h> |
| 9 | |
Matt Menke | dadd6c7 | 2018-01-30 23:07:25 | [diff] [blame] | 10 | #include "base/cancelable_callback.h" |
Avi Drissman | 41c4a41 | 2023-01-11 22:45:37 | [diff] [blame^] | 11 | #include "base/functional/callback.h" |
Matt Menke | dadd6c7 | 2018-01-30 23:07:25 | [diff] [blame] | 12 | |
| 13 | namespace net { |
| 14 | |
| 15 | // A OnceCallback specialization that takes a single int parameter. Usually this |
| 16 | // is used to report a byte count or network error code. |
Bence Béky | 61f756c | 2018-04-25 14:17:53 | [diff] [blame] | 17 | using CompletionOnceCallback = base::OnceCallback<void(int)>; |
Matt Menke | dadd6c7 | 2018-01-30 23:07:25 | [diff] [blame] | 18 | |
| 19 | // 64bit version of the OnceCallback specialization that takes a single int64_t |
| 20 | // parameter. Usually this is used to report a file offset, size or network |
| 21 | // error code. |
Bence Béky | 61f756c | 2018-04-25 14:17:53 | [diff] [blame] | 22 | using Int64CompletionOnceCallback = base::OnceCallback<void(int64_t)>; |
Matt Menke | dadd6c7 | 2018-01-30 23:07:25 | [diff] [blame] | 23 | |
Bence Béky | 61f756c | 2018-04-25 14:17:53 | [diff] [blame] | 24 | using CancelableCompletionOnceCallback = |
| 25 | base::CancelableOnceCallback<void(int)>; |
Matt Menke | dadd6c7 | 2018-01-30 23:07:25 | [diff] [blame] | 26 | |
| 27 | } // namespace net |
| 28 | |
| 29 | #endif // NET_BASE_COMPLETION_ONCE_CALLBACK_H_ |