aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJonas Olsson <jonasolsson@webrtc.org>2019-06-11 14:29:40 +0200
committerCommit Bot <commit-bot@chromium.org>2019-06-11 14:11:06 +0000
commit5b2eda4895609b4c6b1e0a7f43f77e36acc87bc5 (patch)
tree9e40ae6ef20e10097da12a71420552dc28ce5fbd /examples
parente8e4dc4c8b3ecff3d331517917a981466a55cf22 (diff)
downloadwebrtc-5b2eda4895609b4c6b1e0a7f43f77e36acc87bc5.tar.gz
Sanity-check field trial string at initialization.
It's easy to make small errors when building field trial strings, and those errors can cause all sorts of weird problems. This CL checks if the FT string has an odd number of delimiters, duplicate names or any trailing chars. If so we'll log a error message. On debug builds we'll also crash. Bug: webrtc:10729 Change-Id: Iebf7155d9b117a02d1e9cfe7f64408e11df2aec5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/140866 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org> Cr-Commit-Position: refs/heads/master@{#28234}
Diffstat (limited to 'examples')
-rw-r--r--examples/peerconnection/client/linux/main.cc1
-rw-r--r--examples/peerconnection/client/main.cc1
-rw-r--r--examples/peerconnection/server/main.cc2
3 files changed, 1 insertions, 3 deletions
diff --git a/examples/peerconnection/client/linux/main.cc b/examples/peerconnection/client/linux/main.cc
index 7c073149e3..da2fd24de3 100644
--- a/examples/peerconnection/client/linux/main.cc
+++ b/examples/peerconnection/client/linux/main.cc
@@ -83,7 +83,6 @@ int main(int argc, char* argv[]) {
return 0;
}
- webrtc::test::ValidateFieldTrialsStringOrDie(FLAG_force_fieldtrials);
// InitFieldTrialsFromString stores the char*, so the char array must outlive
// the application.
webrtc::field_trial::InitFieldTrialsFromString(FLAG_force_fieldtrials);
diff --git a/examples/peerconnection/client/main.cc b/examples/peerconnection/client/main.cc
index 6c7178af55..4299440d52 100644
--- a/examples/peerconnection/client/main.cc
+++ b/examples/peerconnection/client/main.cc
@@ -89,7 +89,6 @@ int PASCAL wWinMain(HINSTANCE instance,
return 0;
}
- webrtc::test::ValidateFieldTrialsStringOrDie(FLAG_force_fieldtrials);
// InitFieldTrialsFromString stores the char*, so the char array must outlive
// the application.
webrtc::field_trial::InitFieldTrialsFromString(FLAG_force_fieldtrials);
diff --git a/examples/peerconnection/server/main.cc b/examples/peerconnection/server/main.cc
index fdc84ddbc2..79b2c2ce3b 100644
--- a/examples/peerconnection/server/main.cc
+++ b/examples/peerconnection/server/main.cc
@@ -15,6 +15,7 @@
#include <sys/select.h>
#endif
#include <time.h>
+
#include <string>
#include <vector>
@@ -76,7 +77,6 @@ int main(int argc, char* argv[]) {
return 0;
}
- webrtc::test::ValidateFieldTrialsStringOrDie(FLAG_force_fieldtrials);
// InitFieldTrialsFromString stores the char*, so the char array must outlive
// the application.
webrtc::field_trial::InitFieldTrialsFromString(FLAG_force_fieldtrials);