Chromium Code Reviews| Index: components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h |
| diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h |
| index 2415143b978de1edd9351cf5baaad0f3d189b844..1a79dfb7129cf61bcaabcf83c890d355a0971671 100644 |
| --- a/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h |
| +++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_headers.h |
| @@ -11,6 +11,8 @@ |
| #include "base/macros.h" |
| #include "base/strings/string_piece.h" |
| #include "base/time/time.h" |
| +#include "net/http/http_request_headers.h" |
| +#include "net/http/http_response_headers.h" |
| #include "net/proxy/proxy_service.h" |
| class GURL; |
| @@ -21,6 +23,15 @@ class HttpResponseHeaders; |
| namespace data_reduction_proxy { |
| +// Transform types that may be parsed out of http headers. |
|
bengr
2017/06/28 16:45:51
http -> http response
dougarnett
2017/06/28 22:12:39
but also request headers (was trying to avoid defi
|
| +enum TransformType { |
|
bengr
2017/06/28 16:45:51
A policy isn't a transform type. How about "Transf
dougarnett
2017/06/28 22:12:39
DIRECTIVE? That terminoloy is used on the constant
bengr
2017/06/29 00:25:05
Sgtm.
|
| + TRANSFORM_NONE, |
|
bengr
2017/06/28 16:45:51
Do we need the prefix "TRANSFORM_" ?
dougarnett
2017/06/28 22:12:39
Wanted to avoid confusion with PreviewsState::LITE
|
| + TRANSFORM_LITE_PAGE, |
| + TRANSFORM_EMPTY_IMAGE, |
| + TRANSFORM_COMPRESS_VIDEO, |
|
bengr
2017/06/28 16:45:51
Is this a request or a response? If the latter (an
dougarnett
2017/06/28 22:12:38
Done.
|
| + TRANSFORM_PAGE_POLICIES_EMPTY_IMAGE, |
| +}; |
| + |
| // Values of the UMA DataReductionProxy.BypassType{Primary|Fallback} and |
| // DataReductionProxy.BlockType{Primary|Fallback} histograms. This enum must |
| // remain synchronized with the enum of the same name in |
| @@ -116,6 +127,12 @@ const char* if_heavy_qualifier(); |
| // that an empty image has been provided. |
| bool IsEmptyImagePreview(const net::HttpResponseHeaders& headers); |
| +// Parse out the type of accepted transform, if any, in |headers|. |
|
bengr
2017/06/28 16:45:51
How about:
// Retrieve the transform type, if any,
dougarnett
2017/06/28 22:12:38
Done - added note about behavior for dual transfor
|
| +TransformType ParseRequestTransform(const net::HttpRequestHeaders& headers); |
| + |
| +// Parse out the type of content transform, if any, in |headers|. |
| +TransformType ParseResponseTransform(const net::HttpResponseHeaders& headers); |
| + |
| // Returns true if the provided value of the Chrome-Proxy-Content-Transform |
| // response header that is provided in |content_transform_value| indicates that |
| // an empty image has been provided. |