OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" | 5 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "net/http/http_status_code.h" | 22 #include "net/http/http_status_code.h" |
23 #include "net/http/http_util.h" | 23 #include "net/http/http_util.h" |
24 #include "net/url_request/url_request.h" | 24 #include "net/url_request/url_request.h" |
25 | 25 |
26 using base::StringPiece; | 26 using base::StringPiece; |
27 using base::TimeDelta; | 27 using base::TimeDelta; |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 const char kChromeProxyHeader[] = "chrome-proxy"; | 31 const char kChromeProxyHeader[] = "chrome-proxy"; |
| 32 const char kChromeProxyECTHeader[] = "chrome-proxy-ect"; |
32 const char kChromeProxyAcceptTransformHeader[] = | 33 const char kChromeProxyAcceptTransformHeader[] = |
33 "chrome-proxy-accept-transform"; | 34 "chrome-proxy-accept-transform"; |
34 const char kChromeProxyContentTransformHeader[] = | 35 const char kChromeProxyContentTransformHeader[] = |
35 "chrome-proxy-content-transform"; | 36 "chrome-proxy-content-transform"; |
36 | 37 |
37 const char kActionValueDelimiter = '='; | 38 const char kActionValueDelimiter = '='; |
38 | 39 |
39 // Previews directives. | 40 // Previews directives. |
40 const char kEmptyImageDirective[] = "empty-image"; | 41 const char kEmptyImageDirective[] = "empty-image"; |
41 const char kLitePageDirective[] = "lite-page"; | 42 const char kLitePageDirective[] = "lite-page"; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 120 } |
120 | 121 |
121 } // namespace | 122 } // namespace |
122 | 123 |
123 namespace data_reduction_proxy { | 124 namespace data_reduction_proxy { |
124 | 125 |
125 const char* chrome_proxy_header() { | 126 const char* chrome_proxy_header() { |
126 return kChromeProxyHeader; | 127 return kChromeProxyHeader; |
127 } | 128 } |
128 | 129 |
| 130 const char* chrome_proxy_ect_header() { |
| 131 return kChromeProxyECTHeader; |
| 132 } |
| 133 |
129 const char* chrome_proxy_accept_transform_header() { | 134 const char* chrome_proxy_accept_transform_header() { |
130 return kChromeProxyAcceptTransformHeader; | 135 return kChromeProxyAcceptTransformHeader; |
131 } | 136 } |
132 | 137 |
133 const char* chrome_proxy_content_transform_header() { | 138 const char* chrome_proxy_content_transform_header() { |
134 return kChromeProxyContentTransformHeader; | 139 return kChromeProxyContentTransformHeader; |
135 } | 140 } |
136 | 141 |
137 const char* empty_image_directive() { | 142 const char* empty_image_directive() { |
138 return kEmptyImageDirective; | 143 return kEmptyImageDirective; |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 std::string value; | 429 std::string value; |
425 size_t iter = 0; | 430 size_t iter = 0; |
426 while (headers->EnumerateHeader(&iter, kChromeProxyHeader, &value)) { | 431 while (headers->EnumerateHeader(&iter, kChromeProxyHeader, &value)) { |
427 if (StartsWithActionPrefix(value, kChromeProxyActionFingerprintChromeProxy)) | 432 if (StartsWithActionPrefix(value, kChromeProxyActionFingerprintChromeProxy)) |
428 continue; | 433 continue; |
429 values->push_back(std::move(value)); | 434 values->push_back(std::move(value)); |
430 } | 435 } |
431 } | 436 } |
432 | 437 |
433 } // namespace data_reduction_proxy | 438 } // namespace data_reduction_proxy |
OLD | NEW |