1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_DATA_RESPONSE_PROVIDER_H_
6 #define IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_DATA_RESPONSE_PROVIDER_H_
10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h"
12 #include "ios/web/public/test/response_providers/response_provider.h"
13 #include "net/http/http_response_headers.h"
17 // An abstract ResponseProvider that returns a GCDWebServerDataResponse for a
18 // request. This class encapsulates the logic to convert the response headers
19 // and body received from |GetResponseHeadersAndBody| into a
20 // GCDWebServerDataResponse.
21 class DataResponseProvider
: public ResponseProvider
{
23 // ResponseProvider implementation.
24 GCDWebServerResponse
* GetGCDWebServerResponse(const Request
& request
) final
;
26 // Returns the headers and the response body. Will only be called if the
27 // provider can handle the request.
28 // Note: This should actually be under protected but since this is used by
29 // an adapter in order to work with the old MockHttpServer it is under
31 virtual void GetResponseHeadersAndBody(
32 const Request
& request
,
33 scoped_refptr
<net::HttpResponseHeaders
>* headers
,
34 std::string
* response_body
) = 0;
39 #endif // IOS_WEB_PUBLIC_TEST_RESPONSE_PROVIDERS_DATA_RESPONSE_PROVIDER_H_