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

Unified Diff: net/proxy/proxy_service.cc

Issue 2910473005: Deprecate NonThreadSafe in net/ in favor of SequenceChecker/ThreadChecker. (Closed)
Patch Set: rebase on r476634 Created 3 years, 7 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
« no previous file with comments | « net/proxy/proxy_service.h ('k') | net/ssl/channel_id_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 4a21400ea50315499b8fc2cc0a9d51dbe0ba62b2..68133fecbda5be6b117ef8a20d386c9428b8ae4c 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -1042,7 +1042,7 @@ int ProxyService::ResolveProxyHelper(const GURL& raw_url,
PacRequest** pac_request,
ProxyDelegate* proxy_delegate,
const NetLogWithSource& net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
net_log.BeginEvent(NetLogEventType::PROXY_SERVICE);
@@ -1137,6 +1137,7 @@ int ProxyService::TryToCompleteSynchronously(const GURL& url,
}
ProxyService::~ProxyService() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
NetworkChangeNotifier::RemoveIPAddressObserver(this);
NetworkChangeNotifier::RemoveDNSObserver(this);
config_service_->RemoveObserver(this);
@@ -1272,7 +1273,7 @@ int ProxyService::ReconsiderProxyAfterError(const GURL& url,
PacRequest** pac_request,
ProxyDelegate* proxy_delegate,
const NetLogWithSource& net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
// Check to see if we have a new config since ResolveProxy was called. We
// want to re-run ResolveProxy in two cases: 1) we have a new config, or 2) a
@@ -1314,7 +1315,7 @@ bool ProxyService::MarkProxiesAsBadUntil(
void ProxyService::ReportSuccess(const ProxyInfo& result,
ProxyDelegate* proxy_delegate) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
const ProxyRetryInfoMap& new_retry_info = result.proxy_retry_info();
if (new_retry_info.empty())
@@ -1343,7 +1344,7 @@ void ProxyService::ReportSuccess(const ProxyInfo& result,
}
void ProxyService::CancelPacRequest(PacRequest* req) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(req);
req->Cancel();
RemovePendingRequest(req);
@@ -1454,7 +1455,7 @@ int ProxyService::DidFinishResolvingProxy(const GURL& url,
void ProxyService::SetProxyScriptFetchers(
ProxyScriptFetcher* proxy_script_fetcher,
std::unique_ptr<DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
State previous_state = ResetProxyConfig(false);
proxy_script_fetcher_.reset(proxy_script_fetcher);
dhcp_proxy_script_fetcher_ = std::move(dhcp_proxy_script_fetcher);
@@ -1474,12 +1475,12 @@ void ProxyService::OnShutdown() {
}
ProxyScriptFetcher* ProxyService::GetProxyScriptFetcher() const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
return proxy_script_fetcher_.get();
}
ProxyService::State ProxyService::ResetProxyConfig(bool reset_fetched_config) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
State previous_state = current_state_;
permanent_error_ = OK;
@@ -1498,7 +1499,7 @@ ProxyService::State ProxyService::ResetProxyConfig(bool reset_fetched_config) {
void ProxyService::ResetConfigService(
std::unique_ptr<ProxyConfigService> new_proxy_config_service) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
State previous_state = ResetProxyConfig(true);
// Release the old configuration service.
@@ -1514,7 +1515,7 @@ void ProxyService::ResetConfigService(
}
void ProxyService::ForceReloadProxyConfig() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
ResetProxyConfig(false);
ApplyProxyConfigIfAvailable();
}
« no previous file with comments | « net/proxy/proxy_service.h ('k') | net/ssl/channel_id_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698