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

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

Issue 1721813002: Adding DRP specfic UMA for FirstContentfulPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing lifetime of NavigationSupportsUserData for Draft Created 4 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 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 16467f14922df1455ebfe814c82a3054976a0dad..e8522c822886f9ad2993f315c93210410c9a5628 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
@@ -6,23 +6,25 @@
#include <utility>
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_config.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_configurator.h"
+#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_data.h"
#include "components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.h"
#include "components/data_reduction_proxy/core/common/lofi_decider.h"
+#include "content/browser/frame_host/navigation_user_data.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"
@@ -152,20 +154,28 @@ DataReductionProxyNetworkDelegate::SessionNetworkStatsInfoToValue() const {
base::Int64ToString(total_original_received_bytes_));
return dict;
}
void DataReductionProxyNetworkDelegate::OnBeforeSendProxyHeadersInternal(
net::URLRequest* request,
const net::ProxyInfo& proxy_info,
net::HttpRequestHeaders* headers) {
DCHECK(data_reduction_proxy_config_);
+ content::NavigationUserData* navigation_user_data =
RyanSturm 2016/04/27 23:27:46 Check if this is a DRP proxy and not some other pr
+ static_cast<content::NavigationUserData*>(
+ request->GetUserData(content::kNavigationUserDataKey));
+ if (navigation_user_data) {
+ navigation_user_data->get_navigation_supports_user_data()->SetUserData(
+ kDataReductionProxyUserDataKey, new DataReductionProxyData(true));
+ }
+
if (proxy_info.is_empty())
return;
if (data_reduction_proxy_io_data_ &&
data_reduction_proxy_io_data_->lofi_decider() && request) {
LoFiDecider* lofi_decider = data_reduction_proxy_io_data_->lofi_decider();
bool is_using_lofi_mode = lofi_decider->MaybeAddLoFiDirectiveToHeaders(
*request, headers, proxy_info.proxy_server(),
data_reduction_proxy_config_);

Powered by Google App Engine
This is Rietveld 408576698