Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc |
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc |
index d4f6ae26af03f4a97316ffbc0b7e5f5bbc136cb6..d2991d7df16679a63a812276421bb489c34afa91 100644 |
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc |
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc |
@@ -85,11 +85,17 @@ DataReductionProxyRequestOptions::~DataReductionProxyRequestOptions() { |
} |
void DataReductionProxyRequestOptions::Init() { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
key_ = GetDefaultKey(), |
UpdateCredentials(); |
UpdateExperiments(); |
} |
+std::string DataReductionProxyRequestOptions::GetHeaderValueForTesting() const { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ return header_value_; |
+} |
+ |
void DataReductionProxyRequestOptions::UpdateExperiments() { |
// TODO(bengr): Simplify this so there's only one way to set experiment via |
// flags. See crbug.com/656195. |
@@ -133,16 +139,19 @@ base::string16 DataReductionProxyRequestOptions::AuthHashForSalt( |
} |
base::Time DataReductionProxyRequestOptions::Now() const { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
return base::Time::Now(); |
} |
void DataReductionProxyRequestOptions::RandBytes(void* output, |
size_t length) const { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
crypto::RandBytes(output, length); |
} |
void DataReductionProxyRequestOptions::AddRequestHeader( |
net::HttpRequestHeaders* request_headers) { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
base::Time now = Now(); |
// Authorization credentials must be regenerated if they are expired. |
if (!use_assigned_credentials_ && (now > credentials_expiration_time_)) |
@@ -207,10 +216,12 @@ void DataReductionProxyRequestOptions::SetSecureSession( |
} |
void DataReductionProxyRequestOptions::Invalidate() { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
SetSecureSession(std::string()); |
} |
std::string DataReductionProxyRequestOptions::GetDefaultKey() const { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
const base::CommandLine& command_line = |
*base::CommandLine::ForCurrentProcess(); |
std::string key = |