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

Unified Diff: net/dns/mock_host_resolver.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/dns/mock_host_resolver.h ('k') | net/http/http_auth_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/mock_host_resolver.cc
diff --git a/net/dns/mock_host_resolver.cc b/net/dns/mock_host_resolver.cc
index 57ccf2bfe5f40cea9a85b3944afac1ec74126da5..abf3a9f6d9c407865ec508717d7811f7249e59a9 100644
--- a/net/dns/mock_host_resolver.cc
+++ b/net/dns/mock_host_resolver.cc
@@ -98,6 +98,7 @@ class MockHostResolverBase::RequestImpl : public HostResolver::Request {
};
MockHostResolverBase::~MockHostResolverBase() {
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(requests_.empty());
}
@@ -107,7 +108,7 @@ int MockHostResolverBase::Resolve(const RequestInfo& info,
const CompletionCallback& callback,
std::unique_ptr<Request>* request,
const NetLogWithSource& net_log) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(request);
last_request_priority_ = priority;
num_resolve_++;
@@ -142,7 +143,7 @@ int MockHostResolverBase::ResolveFromCache(const RequestInfo& info,
AddressList* addresses,
const NetLogWithSource& net_log) {
num_resolve_from_cache_++;
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
next_request_id_++;
int rv = ResolveFromIPLiteralOrCache(info, addresses);
return rv;
@@ -159,7 +160,7 @@ HostCache* MockHostResolverBase::GetHostCache() {
}
void MockHostResolverBase::ResolveAllPending() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
DCHECK(ondemand_mode_);
for (RequestMap::iterator i = requests_.begin(); i != requests_.end(); ++i) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
« no previous file with comments | « net/dns/mock_host_resolver.h ('k') | net/http/http_auth_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698