[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 addrinfo* InvalidValue() { return nullptr; }
static void Free(addrinfo* ai) { freeaddrinfo(ai); } static void Free(addrinfo* ai) { freeaddrinfo(ai); }
}; };
using ScopedAddrinfo = using ScopedAddrinfo = base::ScopedGeneric<addrinfo*, ScopedAddrinfoTraits>;
base::ScopedGeneric<addrinfo*, ScopedAddrinfoTraits>;
class Stream { class Stream {
public: public:
@ -81,7 +80,7 @@ class FdStream : public Stream {
return LoggingReadFileExactly(fd_, data, size); return LoggingReadFileExactly(fd_, data, size);
} }
bool LoggingReadToEOF(std::string* result) override{ bool LoggingReadToEOF(std::string* result) override {
return crashpad::LoggingReadToEOF(fd_, result); return crashpad::LoggingReadToEOF(fd_, result);
} }
@ -545,7 +544,8 @@ bool HTTPTransportSocket::ExecuteSynchronously(std::string* response_body) {
} }
#if !defined(CRASHPAD_USE_BORINGSSL) #if !defined(CRASHPAD_USE_BORINGSSL)
CHECK(scheme == "http"); CHECK(scheme == "http") << "Got " << scheme << " for scheme in '" << url()
<< "'";
#endif #endif
base::ScopedFD sock(CreateSocket(hostname, port)); base::ScopedFD sock(CreateSocket(hostname, port));