Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1260)

Side by Side Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc

Issue 2642793005: Create a Lite Page bit for previews and fallback to Lo-Fi (Closed)
Patch Set: remove unused frame_messages.h code Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/browser/data_reduction_proxy_netw ork_delegate.h" 5 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_netw ork_delegate.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 base::TimeDelta freshness_lifetime = 393 base::TimeDelta freshness_lifetime =
394 request.response_headers() 394 request.response_headers()
395 ->GetFreshnessLifetimes(request.response_info().response_time) 395 ->GetFreshnessLifetimes(request.response_info().response_time)
396 .freshness; 396 .freshness;
397 397
398 RecordContentLengthHistograms( 398 RecordContentLengthHistograms(
399 // |data_reduction_proxy_io_data_| can be NULL for Webview. 399 // |data_reduction_proxy_io_data_| can be NULL for Webview.
400 data_reduction_proxy_io_data_ && 400 data_reduction_proxy_io_data_ &&
401 data_reduction_proxy_io_data_->IsEnabled() && 401 data_reduction_proxy_io_data_->IsEnabled() &&
402 data_reduction_proxy_io_data_->lofi_decider() && 402 data_reduction_proxy_io_data_->lofi_decider() &&
403 data_reduction_proxy_io_data_->lofi_decider()->IsUsingLoFiMode( 403 data_reduction_proxy_io_data_->lofi_decider()->IsUsingLoFi(request),
404 request),
405 request.received_response_content_length(), original_content_length, 404 request.received_response_content_length(), original_content_length,
406 freshness_lifetime); 405 freshness_lifetime);
407 406
408 if (data_reduction_proxy_io_data_ && data_reduction_proxy_bypass_stats_) { 407 if (data_reduction_proxy_io_data_ && data_reduction_proxy_bypass_stats_) {
409 // Record BypassedBytes histograms for the request. 408 // Record BypassedBytes histograms for the request.
410 data_reduction_proxy_bypass_stats_->RecordBytesHistograms( 409 data_reduction_proxy_bypass_stats_->RecordBytesHistograms(
411 request, data_reduction_proxy_io_data_->IsEnabled(), 410 request, data_reduction_proxy_io_data_->IsEnabled(),
412 configurator_->GetProxyConfig()); 411 configurator_->GetProxyConfig());
413 } 412 }
414 } 413 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 492
494 request_headers->RemoveHeader(net::HttpRequestHeaders::kAcceptEncoding); 493 request_headers->RemoveHeader(net::HttpRequestHeaders::kAcceptEncoding);
495 if (!header_value.empty()) 494 if (!header_value.empty())
496 header_value += ", "; 495 header_value += ", ";
497 header_value += kBrotli; 496 header_value += kBrotli;
498 request_headers->SetHeader(net::HttpRequestHeaders::kAcceptEncoding, 497 request_headers->SetHeader(net::HttpRequestHeaders::kAcceptEncoding,
499 header_value); 498 header_value);
500 } 499 }
501 500
502 } // namespace data_reduction_proxy 501 } // namespace data_reduction_proxy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698