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_); |
} |