1 // Copyright 2018 The Chromium Authors 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 10 #include "base/cancelable_callback.h" 11 #include "base/functional/callback.h" 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. 17 using CompletionOnceCallback = base::OnceCallback<void(int)>; 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. 22 using Int64CompletionOnceCallback = base::OnceCallback<void(int64_t)>; 23 24 using CancelableCompletionOnceCallback = 25 base::CancelableOnceCallback<void(int)>; 26 27 } // namespace net 28 29 #endif // NET_BASE_COMPLETION_ONCE_CALLBACK_H_ 30