Chromium Code Reviews| Index: chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc |
| diff --git a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc |
| index 0a2881c3935ddbf8f5c5a81cb02c0d8df8bbb334..da8eb0261f53f150bd236390666a45b90ba7ee98 100644 |
| --- a/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc |
| +++ b/chrome/browser/loader/chrome_resource_dispatcher_host_delegate.cc |
| @@ -891,18 +891,20 @@ content::PreviewsState ChromeResourceDispatcherHostDelegate::GetPreviewsState( |
| content::PreviewsState previews_state = content::PREVIEWS_UNSPECIFIED; |
| - if (data_reduction_proxy_io_data) { |
| - if (data_reduction_proxy_io_data->ShouldEnableLoFi(url_request)) |
| + previews::PreviewsIOData* previews_io_data = io_data->previews_io_data(); |
| + if (data_reduction_proxy_io_data && previews_io_data) { |
| + if (data_reduction_proxy_io_data->ShouldEnableLoFi(url_request, |
| + previews_io_data)) |
| previews_state |= content::SERVER_LOFI_ON; |
|
mmenke
2017/05/10 22:32:47
nit: Add braces
RyanSturm
2017/05/10 22:35:43
Done.
|
| - if (data_reduction_proxy_io_data->ShouldEnableLitePages(url_request)) |
| + if (data_reduction_proxy_io_data->ShouldEnableLitePages(url_request, |
| + previews_io_data)) |
| previews_state |= content::SERVER_LITE_PAGE_ON; |
|
mmenke
2017/05/10 22:32:47
+braces
RyanSturm
2017/05/10 22:35:43
Done.
|
| - previews::PreviewsIOData* previews_io_data = io_data->previews_io_data(); |
| // Check that data saver is enabled, the user isn't opted out of LoFi for |
| // the session, and the user is eligible for previews. |
| if (data_reduction_proxy_io_data->IsEnabled() && |
| !data_reduction_proxy_io_data->config()->lofi_off() && |
| - previews_io_data && previews::params::IsClientLoFiEnabled() && |
| + previews::params::IsClientLoFiEnabled() && |
| previews_io_data->ShouldAllowPreviewAtECT( |
| url_request, previews::PreviewsType::LOFI, |
| previews::params:: |