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

Unified Diff: components/policy/core/common/async_policy_provider.cc

Issue 2915493002: Replace deprecated base::NonThreadSafe in components/policy in favor of SequenceChecker. (Closed)
Patch Set: 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
Index: components/policy/core/common/async_policy_provider.cc
diff --git a/components/policy/core/common/async_policy_provider.cc b/components/policy/core/common/async_policy_provider.cc
index efd8987df5654532a459783a3e4f7116e2d9b5ba..d0af42038403149debfe98fa32331c0f444b889a 100644
--- a/components/policy/core/common/async_policy_provider.cc
+++ b/components/policy/core/common/async_policy_provider.cc
@@ -27,11 +27,11 @@ AsyncPolicyProvider::AsyncPolicyProvider(
}
AsyncPolicyProvider::~AsyncPolicyProvider() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
void AsyncPolicyProvider::Init(SchemaRegistry* registry) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
ConfigurationPolicyProvider::Init(registry);
if (!loader_)
@@ -50,7 +50,7 @@ void AsyncPolicyProvider::Init(SchemaRegistry* registry) {
}
void AsyncPolicyProvider::Shutdown() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Note on the lifetime of |loader_|:
// The |loader_| lives on the background thread, and is deleted from here.
// This means that posting tasks on the |loader_| to the background thread
@@ -67,7 +67,7 @@ void AsyncPolicyProvider::Shutdown() {
}
void AsyncPolicyProvider::RefreshPolicies() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Subtle: RefreshPolicies() has a contract that requires the next policy
// update notification (triggered from UpdatePolicy()) to reflect any changes
@@ -91,7 +91,7 @@ void AsyncPolicyProvider::RefreshPolicies() {
}
void AsyncPolicyProvider::ReloadAfterRefreshSync() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// This task can only enter if it was posted from RefreshPolicies(), and it
// hasn't been cancelled meanwhile by another call to RefreshPolicies().
DCHECK(!refresh_callback_.IsCancelled());
@@ -113,7 +113,7 @@ void AsyncPolicyProvider::ReloadAfterRefreshSync() {
void AsyncPolicyProvider::OnLoaderReloaded(
std::unique_ptr<PolicyBundle> bundle) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
// Only propagate policy updates if there are no pending refreshes, and if
// Shutdown() hasn't been called yet.
if (refresh_callback_.IsCancelled() && loader_)

Powered by Google App Engine
This is Rietveld 408576698