completion_once_callback.h 961 B

1234567891011121314151617181920212223242526272829
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef NET_BASE_COMPLETION_ONCE_CALLBACK_H_
  5. #define NET_BASE_COMPLETION_ONCE_CALLBACK_H_
  6. #include <stdint.h>
  7. #include "base/callback.h"
  8. #include "base/cancelable_callback.h"
  9. namespace net {
  10. // A OnceCallback specialization that takes a single int parameter. Usually this
  11. // is used to report a byte count or network error code.
  12. using CompletionOnceCallback = base::OnceCallback<void(int)>;
  13. // 64bit version of the OnceCallback specialization that takes a single int64_t
  14. // parameter. Usually this is used to report a file offset, size or network
  15. // error code.
  16. using Int64CompletionOnceCallback = base::OnceCallback<void(int64_t)>;
  17. using CancelableCompletionOnceCallback =
  18. base::CancelableOnceCallback<void(int)>;
  19. } // namespace net
  20. #endif // NET_BASE_COMPLETION_ONCE_CALLBACK_H_