diff --git a/cobalt/webdriver/server.cc b/cobalt/webdriver/server.cc index 51e5709c89bd..b1bb2071b89b 100644 --- a/cobalt/webdriver/server.cc +++ b/cobalt/webdriver/server.cc @@ -76,7 +76,10 @@ class ResponseHandlerImpl : public WebDriverServer::ResponseHandler { ResponseHandlerImpl(net::HttpServer* server, int connection_id) : task_runner_(base::SequencedTaskRunner::GetCurrentDefault()), server_(server), - connection_id_(connection_id) {} + connection_id_(connection_id) { + server_->SetReceiveBufferSize(connection_id_, kMaxRecieveBufferSize); + server_->SetSendBufferSize(connection_id_, kMaxSendBufferSize); + } // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#responses void Success(std::unique_ptr value) override { diff --git a/cobalt/webdriver/server.h b/cobalt/webdriver/server.h index 7d850aa3e6a7..6575a1ce882f 100644 --- a/cobalt/webdriver/server.h +++ b/cobalt/webdriver/server.h @@ -54,6 +54,9 @@ class WebDriverServer : public net::HttpServer::Delegate { // client. class ResponseHandler { public: + static const int kMaxRecieveBufferSize = 2 * 1024 * 1024; // 2 Mbytes. + static const int kMaxSendBufferSize = 8 * 1024 * 1024; // 8 Mbytes. + // Called after a successful WebDriver command. // https://www.selenium.dev/documentation/legacy/json_wire_protocol/#responses virtual void Success(std::unique_ptr) = 0;