blob: 86f60ed102762cb1bcc8f7f1098a754ad21752e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#ifndef FuzzingStreamListener_h__
#define FuzzingStreamListener_h__
#include "mozilla/SpinEventLoopUntil.h"
#include "nsCOMPtr.h"
#include "nsNetCID.h"
#include "nsString.h"
#include "nsNetUtil.h"
#include "nsIStreamListener.h"
namespace mozilla {
namespace net {
class FuzzingStreamListener final : public nsIStreamListener {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIREQUESTOBSERVER
NS_DECL_NSISTREAMLISTENER
FuzzingStreamListener() = default;
void waitUntilDone() {
SpinEventLoopUntil("net::FuzzingStreamListener::waitUntilDone"_ns,
[&]() { return mChannelDone; });
}
bool isDone() { return mChannelDone; }
private:
~FuzzingStreamListener() = default;
bool mChannelDone = false;
};
} // namespace net
} // namespace mozilla
#endif
|