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

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: Rebase Created 6 years, 2 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 fd8b196f376443176b1b5d0926e14f2624a62292..5a624242b09d658cc5f96a22a8b58b745ffa43dc 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -89,6 +89,10 @@
#if defined(OS_ANDROID)
#include "chrome/browser/android/intercept_download_resource_throttle.h"
#include "chrome/browser/ui/android/infobars/auto_login_prompter.h"
+#include "components/data_reduction_proxy/content/data_reduction_proxy_resource_throttle.h"
+#include "components/data_reduction_proxy/content/data_reduction_proxy_ui_service.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_switches.h"
#include "components/navigation_interception/intercept_navigation_delegate.h"
#endif
@@ -110,6 +114,8 @@ using extensions::StreamsPrivateAPI;
#endif
#if defined(OS_ANDROID)
+using data_reduction_proxy::DataReductionProxyParams;
+using data_reduction_proxy::DataReductionProxyResourceThrottle;
using navigation_interception::InterceptNavigationDelegate;
#endif
@@ -512,6 +518,25 @@ void ChromeResourceDispatcherHostDelegate::AppendStandardResourceThrottles(
}
#endif
+#if defined(OS_ANDROID)
bengr 2014/10/31 17:06:47 Again, gating this on object being instantiated in
megjablon 2014/12/11 23:32:04 Acknowledged.
+ if (io_data->IsDataReductionProxyEnabled() &&
+ DataReductionProxyParams::IsIncludedInBypassWarningTrial()) {
+ DataReductionProxyParams* params =
+ io_data->data_reduction_proxy_params();
+ data_reduction_proxy::DataReductionProxyUIService* service =
+ io_data->data_reduction_proxy_ui_service();
+
+ if (params && service) {
+ throttles->push_back(new DataReductionProxyResourceThrottle(
+ request,
bengr 2014/10/31 17:06:47 These params can probably all fit on one line.
megjablon 2014/12/11 23:32:04 Done.
+ resource_type,
+ service,
+ params));
+ }
+
+ }
+#endif
+
#if defined(ENABLE_MANAGED_USERS)
bool is_subresource_request =
resource_type != content::RESOURCE_TYPE_MAIN_FRAME;

Powered by Google App Engine
This is Rietveld 408576698