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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 684223003: Data Reduction Proxy Interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update copyright year Created 5 years, 11 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/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index a23756dd2d63df6c802ecb7030244570ac62eebc..4de73e61fefe16bf17b76b86928fdaffe4deee95 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -88,6 +88,8 @@
#if defined(OS_ANDROID)
#include "chrome/browser/android/intercept_download_resource_throttle.h"
+#include "components/data_reduction_proxy/content/browser/data_reduction_proxy_resource_throttle.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
#include "components/navigation_interception/intercept_navigation_delegate.h"
#endif
@@ -109,6 +111,7 @@ using extensions::StreamsPrivateAPI;
#endif
#if defined(OS_ANDROID)
+using data_reduction_proxy::DataReductionProxyUIService;
using navigation_interception::InterceptNavigationDelegate;
#endif
@@ -522,6 +525,24 @@ void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles(
}
#endif
+#if defined(OS_ANDROID)
mmenke 2015/01/16 20:15:27 All these OS_ANDROID checks seem very regression p
megjablon 2015/01/17 02:21:48 Done.
+ if (io_data->IsDataReductionProxyEnabled() &&
+ data_reduction_proxy::DataReductionProxyParams::
+ IsInterstitalsCommandLineSwitchOn()) {
mmenke 2015/01/16 20:15:27 Also suggest indenting IsInterstitalsCommandLineSw
mmenke 2015/01/16 20:15:27 I think "IsInterstitalsCommandLineSwitchOn" could
megjablon 2015/01/17 02:21:48 Done.
+ data_reduction_proxy::DataReductionProxyParams* params =
+ io_data->data_reduction_proxy_params();
+ data_reduction_proxy::DataReductionProxyUIService* service =
+ io_data->data_reduction_proxy_ui_service();
+ DCHECK(params);
+ DCHECK(service);
+
+ throttles->push_back(
+ new data_reduction_proxy::DataReductionProxyResourceThrottle(
mmenke 2015/01/16 20:15:27 Suggest renaming this the "DataReductionProxyDebug
megjablon 2015/01/17 02:21:48 Done.
+ request, resource_type, service, params));
+
+ }
mmenke 2015/01/16 20:15:27 Think it's better if the RDHDelegate knows as litt
megjablon 2015/01/17 02:21:48 Done.
+#endif
+
#if defined(ENABLE_SUPERVISED_USERS)
bool is_subresource_request =
resource_type != content::RESOURCE_TYPE_MAIN_FRAME;

Powered by Google App Engine
This is Rietveld 408576698