blob: 732407fb6c158a5be01dda451568364940856c18 [file] [log] [blame]
Avi Drissman64595482022-09-14 20:52:291// Copyright 2018 The Chromium Authors
Matt Menkedadd6c72018-01-30 23:07:252// 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 Menkedadd6c72018-01-30 23:07:2510#include "base/cancelable_callback.h"
Avi Drissman41c4a412023-01-11 22:45:3711#include "base/functional/callback.h"
Matt Menkedadd6c72018-01-30 23:07:2512
13namespace 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éky61f756c2018-04-25 14:17:5317using CompletionOnceCallback = base::OnceCallback<void(int)>;
Matt Menkedadd6c72018-01-30 23:07:2518
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éky61f756c2018-04-25 14:17:5322using Int64CompletionOnceCallback = base::OnceCallback<void(int64_t)>;
Matt Menkedadd6c72018-01-30 23:07:2523
Bence Béky61f756c2018-04-25 14:17:5324using CancelableCompletionOnceCallback =
25 base::CancelableOnceCallback<void(int)>;
Matt Menkedadd6c72018-01-30 23:07:2526
27} // namespace net
28
29#endif // NET_BASE_COMPLETION_ONCE_CALLBACK_H_