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

Unified Diff: components/invalidation/impl/invalidation_service_android.cc

Issue 2909113002: Deprecate NonThreadSafe in components/invalidation 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/invalidation/impl/invalidation_service_android.cc
diff --git a/components/invalidation/impl/invalidation_service_android.cc b/components/invalidation/impl/invalidation_service_android.cc
index 9f49da8ef6eb332a8260a52177641acad61d12c4..acb5322a7e8e9ef78cc67a8156556ebf15d6de2b 100644
--- a/components/invalidation/impl/invalidation_service_android.cc
+++ b/components/invalidation/impl/invalidation_service_android.cc
@@ -21,7 +21,7 @@ namespace invalidation {
InvalidationServiceAndroid::InvalidationServiceAndroid()
: invalidator_state_(syncer::INVALIDATIONS_ENABLED), logger_() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
JNIEnv* env = base::android::AttachCurrentThread();
base::android::ScopedJavaLocalRef<jobject> local_java_ref =
Java_InvalidationService_create(env, reinterpret_cast<intptr_t>(this));
@@ -29,11 +29,13 @@ InvalidationServiceAndroid::InvalidationServiceAndroid()
logger_.OnStateChange(invalidator_state_);
}
-InvalidationServiceAndroid::~InvalidationServiceAndroid() { }
+InvalidationServiceAndroid::~InvalidationServiceAndroid() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+}
void InvalidationServiceAndroid::RegisterInvalidationHandler(
syncer::InvalidationHandler* handler) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
invalidator_registrar_.RegisterHandler(handler);
logger_.OnRegistration(handler->GetOwnerName());
}
@@ -41,7 +43,7 @@ void InvalidationServiceAndroid::RegisterInvalidationHandler(
bool InvalidationServiceAndroid::UpdateRegisteredInvalidationIds(
syncer::InvalidationHandler* handler,
const syncer::ObjectIdSet& ids) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
JNIEnv* env = base::android::AttachCurrentThread();
DCHECK(env);
@@ -70,19 +72,19 @@ bool InvalidationServiceAndroid::UpdateRegisteredInvalidationIds(
void InvalidationServiceAndroid::UnregisterInvalidationHandler(
syncer::InvalidationHandler* handler) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
invalidator_registrar_.UnregisterHandler(handler);
logger_.OnUnregistration(handler->GetOwnerName());
}
syncer::InvalidatorState
InvalidationServiceAndroid::GetInvalidatorState() const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
return invalidator_state_;
}
std::string InvalidationServiceAndroid::GetInvalidatorClientId() const {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
JNIEnv* env = base::android::AttachCurrentThread();
DCHECK(env);
@@ -112,7 +114,7 @@ IdentityProvider* InvalidationServiceAndroid::GetIdentityProvider() {
void InvalidationServiceAndroid::TriggerStateChangeForTest(
syncer::InvalidatorState state) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
invalidator_state_ = state;
invalidator_registrar_.UpdateInvalidatorState(invalidator_state_);
}
« no previous file with comments | « components/invalidation/impl/invalidation_service_android.h ('k') | components/invalidation/impl/p2p_invalidation_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698