Index: components/invalidation/impl/gcm_network_channel.cc |
diff --git a/components/invalidation/impl/gcm_network_channel.cc b/components/invalidation/impl/gcm_network_channel.cc |
index 47b95b4dda26bad055e08a4efa09903abbcf18e0..31ee115fca996fe81ffb66d83b2bfe4ca67bea30 100644 |
--- a/components/invalidation/impl/gcm_network_channel.cc |
+++ b/components/invalidation/impl/gcm_network_channel.cc |
@@ -131,6 +131,7 @@ GCMNetworkChannel::GCMNetworkChannel( |
} |
GCMNetworkChannel::~GCMNetworkChannel() { |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
net::NetworkChangeNotifier::RemoveNetworkChangeObserver(this); |
} |
@@ -142,7 +143,7 @@ void GCMNetworkChannel::Register() { |
void GCMNetworkChannel::OnRegisterComplete( |
const std::string& registration_id, |
gcm::GCMClient::Result result) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
if (result == gcm::GCMClient::SUCCESS) { |
DCHECK(!registration_id.empty()); |
DVLOG(2) << "Got registration_id"; |
@@ -174,7 +175,7 @@ void GCMNetworkChannel::OnRegisterComplete( |
} |
void GCMNetworkChannel::SendMessage(const std::string& message) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
DCHECK(!message.empty()); |
DVLOG(2) << "SendMessage"; |
diagnostic_info_.sent_messages_count_++; |
@@ -189,7 +190,7 @@ void GCMNetworkChannel::SendMessage(const std::string& message) { |
} |
void GCMNetworkChannel::RequestAccessToken() { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
delegate_->RequestToken(base::Bind(&GCMNetworkChannel::OnGetTokenComplete, |
weak_factory_.GetWeakPtr())); |
} |
@@ -197,7 +198,7 @@ void GCMNetworkChannel::RequestAccessToken() { |
void GCMNetworkChannel::OnGetTokenComplete( |
const GoogleServiceAuthError& error, |
const std::string& token) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
if (cached_message_.empty() || registration_id_.empty()) { |
// Nothing to do. |
return; |
@@ -276,7 +277,7 @@ void GCMNetworkChannel::OnGetTokenComplete( |
} |
void GCMNetworkChannel::OnURLFetchComplete(const net::URLFetcher* source) { |
- DCHECK(CalledOnValidThread()); |
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
DCHECK_EQ(fetcher_.get(), source); |
// Free fetcher at the end of function. |
std::unique_ptr<net::URLFetcher> fetcher = std::move(fetcher_); |