 Chromium Code Reviews
 Chromium Code Reviews Issue 2802843003:
  Update CPAT protocol to send lite-page transform acceptance with ect
    
  
    Issue 2802843003:
  Update CPAT protocol to send lite-page transform acceptance with ect 
  | Index: components/data_reduction_proxy/core/common/lofi_decider.h | 
| diff --git a/components/data_reduction_proxy/core/common/lofi_decider.h b/components/data_reduction_proxy/core/common/lofi_decider.h | 
| index 2eca7590fdb2d5545c9dd490b95edeecfb31c5ef..0ae253b49ec46f21001716a05bd75425692b1b0a 100644 | 
| --- a/components/data_reduction_proxy/core/common/lofi_decider.h | 
| +++ b/components/data_reduction_proxy/core/common/lofi_decider.h | 
| @@ -2,8 +2,8 @@ | 
| // Use of this source code is governed by a BSD-style license that can be | 
| // found in the LICENSE file. | 
| -#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ | 
| -#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ | 
| +#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_LOFI_DECIDER_H_ | 
| +#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_LOFI_DECIDER_H_ | 
| #include "base/macros.h" | 
| @@ -25,17 +25,12 @@ class LoFiDecider { | 
| virtual bool IsUsingLoFi(const net::URLRequest& request) const = 0; | 
| // Adds a previews-specific directive to the Chrome-Proxy-Accept-Transform | 
| - // header if needed. If a slow page preview is triggered, adds "lite-page" or | 
| + // header if needed. If a preview is triggered, adds "lite-page" or | 
| // "empty-image", depending on whether the request is for the main frame | 
| // and lite pages are enabled, or for a subresource and Lo-Fi mode is enabled, | 
| - // respectively. If a slow page preview is not triggered, "lite-page;if-heavy" | 
| - // and "empty-image;if-heavy" are added in the respective aforementioned cases | 
| - // to request that the server transform the page if it determines it to be | 
| - // heavy. Previews-related transformation headers are never added if | 
| - // |is_previews_disabled| is true. | 
| + // respectively. | 
| virtual void MaybeSetAcceptTransformHeader( | 
| const net::URLRequest& request, | 
| 
bengr
2017/05/01 16:53:14
This doesn't need the whole request. It uses the r
 | 
| - bool are_previews_disabled, | 
| net::HttpRequestHeaders* headers) const = 0; | 
| // Returns true if |headers| contains the Chrome-Proxy-Accept-Transform | 
| @@ -54,17 +49,19 @@ class LoFiDecider { | 
| virtual void RemoveAcceptTransformHeader( | 
| net::HttpRequestHeaders* headers) const = 0; | 
| - // Adds a directive to tell the server to ignore blacklists when a Lite Page | 
| - // preview is being requested due to command line flags being set. | 
| - virtual void MaybeSetIgnorePreviewsBlacklistDirective( | 
| + // Adds a directive to tell the server to return a Lite Page preview due to | 
| + // command line flags being set (in spite of a good network connection, the | 
| 
bengr
2017/05/01 16:53:14
I would stay away from commenting on the types of
 | 
| + // page being blacklisted, or the page not being heavy). | 
| + virtual void MaybeSetForceLitePageDirective( | 
| net::HttpRequestHeaders* headers) const = 0; | 
| - // Returns true if the Lo-Fi specific UMA should be recorded. It is set to | 
| - // true if Lo-Fi is enabled for |request|, Chrome session is in Lo-Fi | 
| - // Enabled or Control field trial, and the network quality was slow. | 
| - virtual bool ShouldRecordLoFiUMA(const net::URLRequest& request) const = 0; | 
| + // Returns true if the Previews specific UMA should be recorded. It is set to | 
| 
bengr
2017/05/01 16:53:14
Previews specific -> Previews-specific
Also, prev
 | 
| + // true if Lo-Fi is enabled for |request| and Chrome session is in Lo-Fi | 
| + // Enabled or Control field trial. | 
| + virtual bool ShouldRecordPreviewsUMA( | 
| + const net::URLRequest& request) const = 0; | 
| }; | 
| } // namespace data_reduction_proxy | 
| -#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_LOFI_DECIDER_H_ | 
| +#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_LOFI_DECIDER_H_ |