AW: workaround empty ReasonPhrase

ReasonPhrase may legitimately be "empty" for HTTP/2 (and, even for HTTP
1.1). Unfortunately, when we call the WebResourceResponse constructor in
the WebViewClientCompat code path, this constructor throws an exception
(it wrongly asserts we provide a reasonPhrase).

We must call this version of the constructor in this code path, since
the less-restrictive constructor is only available on >= M (and we must
support L).

This only applies this workaround for the WebViewClientCompat code path,
since there's little justification to faking out the ReasonPhrase except
to avoid the crash.

This skips automated tests, since that would require an HTTP/2 test
server (which I don't believe we support).

R=changwan@chromium.org

Bug: 925887
Test: Manual - load https://putsreq.com/lSTsA2yWOJ3I6vXgLv2z (this \
Test: returns a 405 status code, and is hosted on an HTTP/2 site)
Change-Id: I19d5d45f5695ae51cf474845182a13f71e9fbb4b
Reviewed-on: https://chromium-review.googlesource.com/c/1452789
Reviewed-by: Changwan Ryu <changwan@chromium.org>
Commit-Queue: Nate Fischer <ntfschr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#628953}
1 file changed