Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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/content/browser/content_lofi_decider.h " | 5 #include "components/data_reduction_proxy/content/browser/content_lofi_decider.h " |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade rs.h" | 9 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade rs.h" |
| 10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" | 10 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 70 // to other requests when previews are enabled. If previews are not enabled, | 70 // to other requests when previews are enabled. If previews are not enabled, |
| 71 // add "q=low". | 71 // add "q=low". |
| 72 if (lofi_preview_via_flag_or_field_trial) { | 72 if (lofi_preview_via_flag_or_field_trial) { |
| 73 if (request.load_flags() & net::LOAD_MAIN_FRAME) { | 73 if (request.load_flags() & net::LOAD_MAIN_FRAME) { |
| 74 if (params::AreLoFiPreviewsEnabledViaFlags()) { | 74 if (params::AreLoFiPreviewsEnabledViaFlags()) { |
| 75 header_value += chrome_proxy_lo_fi_ignore_preview_blacklist_directive(); | 75 header_value += chrome_proxy_lo_fi_ignore_preview_blacklist_directive(); |
| 76 header_value += ", "; | 76 header_value += ", "; |
| 77 } | 77 } |
| 78 header_value += chrome_proxy_lo_fi_preview_directive(); | 78 header_value += chrome_proxy_lo_fi_preview_directive(); |
| 79 } | 79 } |
| 80 } else { | 80 } else if (!(request.load_flags() & net::LOAD_MAIN_FRAME)) { |
| 81 // Do not add Lo-Fi header for main frame requests. | |
| 81 header_value += chrome_proxy_lo_fi_directive(); | 82 header_value += chrome_proxy_lo_fi_directive(); |
| 82 } | 83 } |
| 83 | 84 |
| 84 // |header_value| may be empty because the Lo-Fi directive is not added | 85 // |header_value| may be empty because the Lo-Fi directive is not added |
| 85 // to subrequests when preview mode is enabled. | 86 // to subrequests when preview mode is enabled. |
|
megjablon
2016/06/21 00:34:03
Update this comment.
tbansal1
2016/06/22 18:08:38
I removed the comment because it was incorrect. |h
| |
| 86 if (!header_value.empty()) | 87 if (!header_value.empty()) |
| 87 headers->SetHeader(chrome_proxy_header(), header_value); | 88 headers->SetHeader(chrome_proxy_header(), header_value); |
| 88 | 89 |
| 89 return true; | 90 return true; |
| 90 } | 91 } |
| 91 | 92 |
| 92 } // namespace data_reduction_proxy | 93 } // namespace data_reduction_proxy |
| OLD | NEW |