Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc

Issue 2365373002: Add autothread to pseudo-tcp fuzzer. (Closed)
Patch Set: Added const, comments for thread. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc
diff --git a/webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc b/webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc
index f373e6cf9f1a1e31d86557ad987fe9fa3d48ba8d..4e14a13eebab87884d2144fbdeb4119da4fe1d10 100644
--- a/webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc
+++ b/webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc
@@ -11,6 +11,7 @@
#include <stddef.h>
#include <stdint.h>
+#include "webrtc/base/thread.h"
#include "webrtc/p2p/base/pseudotcp.h"
namespace webrtc {
@@ -29,10 +30,15 @@ class FakeIPseudoTcpNotify : public cricket::IPseudoTcpNotify {
};
struct Environment {
- cricket::PseudoTcp* ptcp;
- explicit Environment(cricket::IPseudoTcpNotify* notifier) {
- ptcp = new cricket::PseudoTcp(notifier, 0);
+ explicit Environment(cricket::IPseudoTcpNotify* notifier):
+ ptcp(new cricket::PseudoTcp(notifier, 0)) {
}
+
+ cricket::PseudoTcp* const ptcp;
+
+ // We need the thread to avoid some uninteresting crashes, since the
+ // production code expects there to be a thread object available.
+ rtc::AutoThread thread;
};
Environment* env = new Environment(new FakeIPseudoTcpNotify());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698