// Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "net/test/embedded_test_server/http_connection.h" #include "net/socket/stream_socket.h" #include "net/test/embedded_test_server/http1_connection.h" #include "net/test/embedded_test_server/http2_connection.h" namespace net::test_server { std::unique_ptr HttpConnection::Create( std::unique_ptr socket, EmbeddedTestServerConnectionListener* listener, EmbeddedTestServer* server, Protocol protocol) { switch (protocol) { case Protocol::kHttp1: return std::make_unique(std::move(socket), listener, server); case Protocol::kHttp2: return std::make_unique(std::move(socket), listener, server); } } } // namespace net::test_server