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

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

Issue 2546023002: Initialize data reduction proxy bypass stats on IO thread (Closed)
Patch Set: More Created 4 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: components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc
index 90be43e85308dfa7d22cd845d65c580249a713e5..f4d38f3d7b4c84abc748626d93fd8f376b2b0427 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_interceptor.cc
@@ -38,6 +38,8 @@ DataReductionProxyInterceptor::~DataReductionProxyInterceptor() {
net::URLRequestJob* DataReductionProxyInterceptor::MaybeInterceptRequest(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
return nullptr;
}
@@ -45,12 +47,16 @@ net::URLRequestJob* DataReductionProxyInterceptor::MaybeInterceptRedirect(
net::URLRequest* request,
net::NetworkDelegate* network_delegate,
const GURL& location) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
return MaybeInterceptResponseOrRedirect(request, network_delegate);
}
net::URLRequestJob* DataReductionProxyInterceptor::MaybeInterceptResponse(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
return MaybeInterceptResponseOrRedirect(request, network_delegate);
}
@@ -58,6 +64,8 @@ net::URLRequestJob*
DataReductionProxyInterceptor::MaybeInterceptResponseOrRedirect(
net::URLRequest* request,
net::NetworkDelegate* network_delegate) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
DCHECK(request);
if (request->response_info().was_cached)
return nullptr;
@@ -107,6 +115,8 @@ void DataReductionProxyInterceptor::MaybeAddBypassEvent(
const DataReductionProxyInfo& data_reduction_proxy_info,
DataReductionProxyBypassType bypass_type,
bool should_retry) const {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
if (data_reduction_proxy_info.bypass_action != BYPASS_ACTION_TYPE_NONE) {
event_creator_->AddBypassActionEvent(
request->net_log(), data_reduction_proxy_info.bypass_action,

Powered by Google App Engine
This is Rietveld 408576698