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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 390533003: Bypassed Bytes UMAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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: chrome/browser/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 6558ae123a8d01eac386242f1b1d44222e8e392a..585655ca00be55bf6ef52e66aaf7c61e57e948b4 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -36,6 +36,7 @@
#include "components/data_reduction_proxy/browser/data_reduction_proxy_params.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_protocol.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.h"
+#include "components/data_reduction_proxy/common/data_reduction_proxy_pref_names.h"
#include "components/domain_reliability/monitor.h"
#include "components/google/core/browser/google_util.h"
#include "content/public/browser/browser_thread.h"
@@ -292,6 +293,7 @@ ChromeNetworkDelegate::ChromeNetworkDelegate(
enable_referrers_(enable_referrers),
enable_do_not_track_(NULL),
force_google_safe_search_(NULL),
+ spdy_proxy_auth_enabled_(NULL),
#if defined(ENABLE_CONFIGURATION_POLICY)
url_blacklist_manager_(NULL),
#endif
@@ -346,6 +348,7 @@ void ChromeNetworkDelegate::InitializePrefsOnUIThread(
BooleanPrefMember* enable_referrers,
BooleanPrefMember* enable_do_not_track,
BooleanPrefMember* force_google_safe_search,
+ BooleanPrefMember* spdy_proxy_auth_enabled,
PrefService* pref_service) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
enable_referrers->Init(prefs::kEnableReferrers, pref_service);
@@ -361,6 +364,13 @@ void ChromeNetworkDelegate::InitializePrefsOnUIThread(
force_google_safe_search->MoveToThread(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
}
+ if (spdy_proxy_auth_enabled) {
+ spdy_proxy_auth_enabled->Init(data_reduction_proxy::prefs::
bengr 2014/07/12 00:11:59 Move data_reduction_proxy::prefs to the next line,
megjablon 2014/07/14 19:06:40 Done.
+ kDataReductionProxyEnabled,
+ pref_service);
+ spdy_proxy_auth_enabled->MoveToThread(
+ BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
+ }
}
// static
@@ -506,6 +516,7 @@ int ChromeNetworkDelegate::OnHeadersReceived(
GURL* allowed_unsafe_redirect_url) {
if (data_reduction_proxy::MaybeBypassProxyAndPrepareToRetry(
data_reduction_proxy_params_,
+ data_reduction_proxy_usage_stats_,
request,
original_response_headers,
override_response_headers)) {
@@ -598,6 +609,11 @@ void ChromeNetworkDelegate::OnCompleted(net::URLRequest* request,
RecordContentLengthHistograms(received_content_length,
original_content_length,
freshness_lifetime);
+ if (spdy_proxy_auth_enabled_ && spdy_proxy_auth_enabled_->GetValue()) {
bengr 2014/07/12 00:11:59 If you guard this with spdy_proxy_auth_enabled_, t
megjablon 2014/07/14 19:06:41 Would it be helpful for us to know of these bypass
bengr 2014/07/14 22:04:29 It would be helpful, but would require extra work.
+ data_reduction_proxy_usage_stats_->RecordBypassedBytesHistograms(
+ received_content_length,
+ request);
bengr 2014/07/12 00:11:59 |request| can move up a line.
megjablon 2014/07/14 19:06:40 Done.
+ }
DVLOG(2) << __FUNCTION__
<< " received content length: " << received_content_length
<< " original content length: " << original_content_length

Powered by Google App Engine
This is Rietveld 408576698