[util/net] add error message to scheme check

* instead of just 'Check failed: scheme == "http"', we will have something
like 'Check failed: scheme == "http". Got 'https' for scheme in 'https://for.bar''
* clangfmt on file

Bug: fuchsia:DX-514
Change-Id: I043af7281d7f99ed5641c87920d806e340a38dea
Tested=`out/Debug/crashpad_util_test` and Fuchsia logs
Reviewed-on: https://chromium-review.googlesource.com/c/1262140
Commit-Queue: Francois Rousseau <frousseau@google.com>
Reviewed-by: Scott Graham <scottmg@chromium.org>
This commit is contained in:
Francois Rousseau 2018-10-04 13:21:20 -07:00 committed by Commit Bot
parent 21edfd3c3a
commit ce122b644c

View File

@ -57,8 +57,7 @@ struct ScopedAddrinfoTraits {
static addrinfo* InvalidValue() { return nullptr; }
static void Free(addrinfo* ai) { freeaddrinfo(ai); }
};
using ScopedAddrinfo =
base::ScopedGeneric<addrinfo*, ScopedAddrinfoTraits>;
using ScopedAddrinfo = base::ScopedGeneric<addrinfo*, ScopedAddrinfoTraits>;
class Stream {
public:
@ -545,7 +544,8 @@ bool HTTPTransportSocket::ExecuteSynchronously(std::string* response_body) {
}
#if !defined(CRASHPAD_USE_BORINGSSL)
CHECK(scheme == "http");
CHECK(scheme == "http") << "Got " << scheme << " for scheme in '" << url()
<< "'";
#endif
base::ScopedFD sock(CreateSocket(hostname, port));