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

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

Issue 775773002: Add data reduction proxy debug info to net-internals#bandwidth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 ae84c3eb7eb7b887cbf8ad2baf8febf69a305fa7..9f483d03f9c9b8fa3057cf314c1f48ff495f4244 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -266,7 +266,8 @@ ChromeNetworkDelegate::ChromeNetworkDelegate(
data_reduction_proxy_params_(NULL),
data_reduction_proxy_usage_stats_(NULL),
data_reduction_proxy_auth_request_handler_(NULL),
- data_reduction_proxy_statistics_prefs_(NULL) {
+ data_reduction_proxy_statistics_prefs_(NULL),
+ data_reduction_proxy_event_store_(NULL) {
DCHECK(enable_referrers);
extensions_delegate_.reset(
ChromeExtensionsNetworkDelegate::Create(event_router));
@@ -377,6 +378,26 @@ base::Value* ChromeNetworkDelegate::SessionNetworkStatsInfoToValue() const {
return dict;
}
+base::Value* ChromeNetworkDelegate::DataReductionProxyInfoToValue() const {
+ base::DictionaryValue* data_reduction_proxy_info =
+ new base::DictionaryValue();
+
+ if (data_reduction_proxy_enabled_) {
+ data_reduction_proxy_info->SetString(
+ "enabled",
+ data_reduction_proxy_enabled_->GetValue() ? "true" : "false");
+ } else {
+ data_reduction_proxy_info->SetString("enabled", "unknown");
+ }
+
+ if (data_reduction_proxy_event_store_) {
+ data_reduction_proxy_event_store_->AddStoredEvents(
+ data_reduction_proxy_info);
+ }
+
+ return data_reduction_proxy_info;
+}
+
int ChromeNetworkDelegate::OnBeforeURLRequest(
net::URLRequest* request,
const net::CompletionCallback& callback,

Powered by Google App Engine
This is Rietveld 408576698