Commit ec47130f authored by Benoit Lize's avatar Benoit Lize Committed by Commit Bot

[customtabs] Increase max response size of DetachedResourceRequest.

Some misconfigured servers redirect to a 200 code instead of a 204,
meaning that the response payload can be quite large. This is not an
issue in practice, but it does confuse metrics a bit. Since there is no
harm in increasing the limit, do it to make metrics easier to
understand.

Bug: 816837
Change-Id: I908a3cad22779b57bdb78f5957e8839048ee3597
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2339981Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Commit-Queue: Benoit L <lizeb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795533}
parent 06b5dabe
...@@ -39,7 +39,7 @@ namespace customtabs { ...@@ -39,7 +39,7 @@ namespace customtabs {
// This is a UI thread class. // This is a UI thread class.
class DetachedResourceRequest { class DetachedResourceRequest {
public: public:
static constexpr int kMaxResponseSize = 100 * 1024; static constexpr int kMaxResponseSize = 500 * 1024;
// The motivation of the resource request, used for histograms reporting. // The motivation of the resource request, used for histograms reporting.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.customtabs // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.customtabs
......
...@@ -143,9 +143,8 @@ std::unique_ptr<HttpResponse> LargeHeadersAndResponseSize( ...@@ -143,9 +143,8 @@ std::unique_ptr<HttpResponse> LargeHeadersAndResponseSize(
return nullptr; return nullptr;
auto response = std::make_unique<net::test_server::BasicHttpResponse>(); auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->AddCustomHeader( // Maximum header size ios 256kB, stay below it.
"X-Large-Header", response->AddCustomHeader("X-Large-Header", std::string(100 * 1024, 'b'));
std::string(DetachedResourceRequest::kMaxResponseSize, 'b'));
response->set_code(net::HTTP_OK); response->set_code(net::HTTP_OK);
uint32_t length; uint32_t length;
...@@ -163,9 +162,8 @@ std::unique_ptr<HttpResponse> LargeResponseAndCookie( ...@@ -163,9 +162,8 @@ std::unique_ptr<HttpResponse> LargeResponseAndCookie(
auto response = std::make_unique<net::test_server::BasicHttpResponse>(); auto response = std::make_unique<net::test_server::BasicHttpResponse>();
response->AddCustomHeader("Set-Cookie", kCookieFromLargeResponse); response->AddCustomHeader("Set-Cookie", kCookieFromLargeResponse);
response->AddCustomHeader( // Maximum header size ios 256kB, stay below it.
"X-Large-Header", response->AddCustomHeader("X-Large-Header", std::string(100 * 1024, 'b'));
std::string(DetachedResourceRequest::kMaxResponseSize, 'b'));
response->set_code(net::HTTP_OK); response->set_code(net::HTTP_OK);
response->set_content( response->set_content(
std::string(DetachedResourceRequest::kMaxResponseSize + 1, 'a')); std::string(DetachedResourceRequest::kMaxResponseSize + 1, 'a'));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment