#ifndef NET_BASE_TEST_COMPLETION_CALLBACK_H_
#define NET_BASE_TEST_COMPLETION_CALLBACK_H_
#include <stdint.h>
#include <memory>
#include <optional>
#include <utility>
#include "base/compiler_specific.h"
#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "net/base/completion_once_callback.h"
#include "net/base/net_errors.h"
namespace base {
class RunLoop;
}
namespace net {
class IOBuffer;
namespace internal {
class TestCompletionCallbackBaseInternal { … };
template <typename R>
struct NetErrorIsPendingHelper { … };
template <typename R, typename IsPendingHelper = NetErrorIsPendingHelper<R>>
class TestCompletionCallbackTemplate
: public TestCompletionCallbackBaseInternal {
public:
TestCompletionCallbackTemplate(const TestCompletionCallbackTemplate&) =
delete;
TestCompletionCallbackTemplate& operator=(
const TestCompletionCallbackTemplate&) = delete;
~TestCompletionCallbackTemplate() override = default;
R WaitForResult() { … }
R GetResult(R result) { … }
protected:
TestCompletionCallbackTemplate() : … { … }
virtual void SetResult(R result) { … }
private:
R result_;
};
}
class TestClosure : public internal::TestCompletionCallbackBaseInternal { … };
TestCompletionCallbackBase;
TestInt64CompletionCallbackBase;
class TestCompletionCallback : public TestCompletionCallbackBase { … };
class TestInt64CompletionCallback : public TestInt64CompletionCallbackBase { … };
class ReleaseBufferCompletionCallback: public TestCompletionCallback { … };
}
#endif