Catching more errors when parsing ICE server URLs.

Every malformed URL should now produce an error message in JS, rather than
silently failing and possibly printing a warning message to the console (and
possibly crashing).

Also added some unit tests, and made "ParseIceServers" public.

BUG=445002

Review URL: https://codereview.webrtc.org/1344143002

Cr-Commit-Position: refs/heads/master@{#10186}
This commit is contained in:
deadbeef
2015-10-06 11:38:28 -07:00
committed by Commit bot
parent 8104479724
commit 0a6c4ca942
8 changed files with 334 additions and 90 deletions

View File

@ -146,6 +146,11 @@ size_t split(const std::string& source, char delimiter,
size_t tokenize(const std::string& source, char delimiter,
std::vector<std::string>* fields);
// Tokenize, including the empty tokens.
size_t tokenize_with_empty_tokens(const std::string& source,
char delimiter,
std::vector<std::string>* fields);
// Tokenize and append the tokens to fields. Return the new size of fields.
size_t tokenize_append(const std::string& source, char delimiter,
std::vector<std::string>* fields);