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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc

Issue 2010253003: Sending a data saver Pageload metrics pingback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
index 6c989c0e014fd0180ba2b04a9fc4ccc5e9043998..82eb6f27b2cd42542258e846fdf508187ce9d492 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_network_delegate.cc
@@ -21,20 +21,21 @@
#include "components/data_reduction_proxy/core/common/lofi_decider.h"
#include "net/base/load_flags.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/proxy/proxy_info.h"
#include "net/proxy/proxy_server.h"
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_status.h"
+#include "url/gurl.h"
namespace {
// |lofi_low_header_added| is set to true iff Lo-Fi "q=low" request header can
// be added to the Chrome proxy headers.
// |received_content_length| is the number of prefilter bytes received.
// |original_content_length| is the length of resource if accessed directly
// without data saver proxy.
// |freshness_lifetime| contains information on how long the resource will be
// fresh for and how long is the usability.
@@ -195,22 +196,26 @@ void DataReductionProxyNetworkDelegate::OnBeforeSendHeadersInternal(
return;
if (!data_reduction_proxy_config_->IsDataReductionProxy(
proxy_info.proxy_server().host_port_pair(), nullptr)) {
return;
}
// Retrieves DataReductionProxyData from a request, creating a new instance
// if needed.
DataReductionProxyData* data =
DataReductionProxyData::GetDataAndCreateIfNecessary(request);
- if (data)
+ if (data) {
data->set_used_data_reduction_proxy(true);
+ data->set_session_key(
+ data_reduction_proxy_request_options_->GetSecureSession());
+ data->set_original_request_url(request->original_url());
+ }
if (data_reduction_proxy_io_data_ &&
data_reduction_proxy_io_data_->lofi_decider()) {
LoFiDecider* lofi_decider = data_reduction_proxy_io_data_->lofi_decider();
bool is_using_lofi_mode =
lofi_decider->MaybeAddLoFiDirectiveToHeaders(*request, headers);
if ((request->load_flags() & net::LOAD_MAIN_FRAME)) {
data_reduction_proxy_io_data_->SetLoFiModeActiveOnMainFrame(
is_using_lofi_mode);

Powered by Google App Engine
This is Rietveld 408576698