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

Unified Diff: components/invalidation/impl/gcm_network_channel.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/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_);
« no previous file with comments | « components/invalidation/impl/gcm_network_channel.h ('k') | components/invalidation/impl/invalidation_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698