diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-25 21:11:36 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-25 21:11:36 +0000 |
commit | 327e52b1a5e90c2af0b9c4e6ecb146d4510f7398 (patch) | |
tree | d8532f5934b28f7ef02e379cedb3d9397586cbc1 /jingle | |
parent | 5f84a0ac03cbb9cab45e2b8fdd8c105c7fd69bbc (diff) | |
download | chromium_src-327e52b1a5e90c2af0b9c4e6ecb146d4510f7398.zip chromium_src-327e52b1a5e90c2af0b9c4e6ecb146d4510f7398.tar.gz chromium_src-327e52b1a5e90c2af0b9c4e6ecb146d4510f7398.tar.bz2 |
Use base::ThreadChecker as a member var, rather than base::NonThreadSafe
BUG=123295
TEST=existing
Review URL: https://chromiumcodereview.appspot.com/10663016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144011 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r-- | jingle/notifier/listener/non_blocking_push_client.cc | 18 | ||||
-rw-r--r-- | jingle/notifier/listener/non_blocking_push_client.h | 4 | ||||
-rw-r--r-- | jingle/notifier/listener/xmpp_push_client.cc | 24 | ||||
-rw-r--r-- | jingle/notifier/listener/xmpp_push_client.h | 4 |
4 files changed, 25 insertions, 25 deletions
diff --git a/jingle/notifier/listener/non_blocking_push_client.cc b/jingle/notifier/listener/non_blocking_push_client.cc index 57ec240..5765d37 100644 --- a/jingle/notifier/listener/non_blocking_push_client.cc +++ b/jingle/notifier/listener/non_blocking_push_client.cc @@ -151,7 +151,7 @@ NonBlockingPushClient::NonBlockingPushClient( } NonBlockingPushClient::~NonBlockingPushClient() { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); delegate_task_runner_->PostTask( FROM_HERE, base::Bind(&NonBlockingPushClient::Core::DestroyOnDelegateThread, @@ -159,18 +159,18 @@ NonBlockingPushClient::~NonBlockingPushClient() { } void NonBlockingPushClient::AddObserver(PushClientObserver* observer) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); observers_.AddObserver(observer); } void NonBlockingPushClient::RemoveObserver(PushClientObserver* observer) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); observers_.RemoveObserver(observer); } void NonBlockingPushClient::UpdateSubscriptions( const SubscriptionList& subscriptions) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); delegate_task_runner_->PostTask( FROM_HERE, base::Bind(&NonBlockingPushClient::Core::UpdateSubscriptions, @@ -179,7 +179,7 @@ void NonBlockingPushClient::UpdateSubscriptions( void NonBlockingPushClient::UpdateCredentials( const std::string& email, const std::string& token) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); delegate_task_runner_->PostTask( FROM_HERE, base::Bind(&NonBlockingPushClient::Core::UpdateCredentials, @@ -188,7 +188,7 @@ void NonBlockingPushClient::UpdateCredentials( void NonBlockingPushClient::SendNotification( const Notification& notification) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); delegate_task_runner_->PostTask( FROM_HERE, base::Bind(&NonBlockingPushClient::Core::SendNotification, core_.get(), @@ -196,21 +196,21 @@ void NonBlockingPushClient::SendNotification( } void NonBlockingPushClient::OnNotificationsEnabled() { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); FOR_EACH_OBSERVER(PushClientObserver, observers_, OnNotificationsEnabled()); } void NonBlockingPushClient::OnNotificationsDisabled( NotificationsDisabledReason reason) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); FOR_EACH_OBSERVER(PushClientObserver, observers_, OnNotificationsDisabled(reason)); } void NonBlockingPushClient::OnIncomingNotification( const Notification& notification) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); FOR_EACH_OBSERVER(PushClientObserver, observers_, OnIncomingNotification(notification)); } diff --git a/jingle/notifier/listener/non_blocking_push_client.h b/jingle/notifier/listener/non_blocking_push_client.h index 9205d71..434f5f4 100644 --- a/jingle/notifier/listener/non_blocking_push_client.h +++ b/jingle/notifier/listener/non_blocking_push_client.h @@ -12,7 +12,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "base/threading/non_thread_safe.h" +#include "base/threading/thread_checker.h" #include "jingle/notifier/listener/push_client.h" #include "jingle/notifier/listener/push_client_observer.h" @@ -57,7 +57,7 @@ class NonBlockingPushClient : public PushClient { void OnNotificationsDisabled(NotificationsDisabledReason reason); void OnIncomingNotification(const Notification& notification); - base::NonThreadSafe non_thread_safe_; + base::ThreadChecker thread_checker_; base::WeakPtrFactory<NonBlockingPushClient> weak_ptr_factory_; const scoped_refptr<base::SingleThreadTaskRunner> delegate_task_runner_; const scoped_refptr<Core> core_; diff --git a/jingle/notifier/listener/xmpp_push_client.cc b/jingle/notifier/listener/xmpp_push_client.cc index 66521f2..9b4811e 100644 --- a/jingle/notifier/listener/xmpp_push_client.cc +++ b/jingle/notifier/listener/xmpp_push_client.cc @@ -19,12 +19,12 @@ XmppPushClient::XmppPushClient(const NotifierOptions& notifier_options) } XmppPushClient::~XmppPushClient() { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); } void XmppPushClient::OnConnect( base::WeakPtr<buzz::XmppTaskParentInterface> base_task) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); base_task_ = base_task; if (!base_task_.get()) { @@ -59,14 +59,14 @@ void XmppPushClient::OnConnect( } void XmppPushClient::OnTransientDisconnection() { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); base_task_.reset(); FOR_EACH_OBSERVER(PushClientObserver, observers_, OnNotificationsDisabled(TRANSIENT_NOTIFICATION_ERROR)); } void XmppPushClient::OnCredentialsRejected() { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); base_task_.reset(); FOR_EACH_OBSERVER( PushClientObserver, observers_, @@ -75,42 +75,42 @@ void XmppPushClient::OnCredentialsRejected() { void XmppPushClient::OnNotificationReceived( const Notification& notification) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); FOR_EACH_OBSERVER(PushClientObserver, observers_, OnIncomingNotification(notification)); } void XmppPushClient::OnSubscribed() { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); FOR_EACH_OBSERVER(PushClientObserver, observers_, OnNotificationsEnabled()); } void XmppPushClient::OnSubscriptionError() { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); FOR_EACH_OBSERVER(PushClientObserver, observers_, OnNotificationsDisabled(TRANSIENT_NOTIFICATION_ERROR)); } void XmppPushClient::AddObserver(PushClientObserver* observer) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); observers_.AddObserver(observer); } void XmppPushClient::RemoveObserver(PushClientObserver* observer) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); observers_.RemoveObserver(observer); } void XmppPushClient::UpdateSubscriptions( const SubscriptionList& subscriptions) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); subscriptions_ = subscriptions; } void XmppPushClient::UpdateCredentials( const std::string& email, const std::string& token) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); DVLOG(1) << "Push: Updating credentials for " << email; xmpp_settings_ = MakeXmppClientSettings(notifier_options_, email, token); if (login_.get()) { @@ -129,7 +129,7 @@ void XmppPushClient::UpdateCredentials( } void XmppPushClient::SendNotification(const Notification& notification) { - DCHECK(non_thread_safe_.CalledOnValidThread()); + DCHECK(thread_checker_.CalledOnValidThread()); if (!base_task_.get()) { // TODO(akalin): Figure out whether we really need to do this. DVLOG(1) << "Push: Cannot send notification " diff --git a/jingle/notifier/listener/xmpp_push_client.h b/jingle/notifier/listener/xmpp_push_client.h index 34cede5..64725d8 100644 --- a/jingle/notifier/listener/xmpp_push_client.h +++ b/jingle/notifier/listener/xmpp_push_client.h @@ -14,7 +14,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "base/threading/non_thread_safe.h" +#include "base/threading/thread_checker.h" #include "jingle/notifier/base/notifier_options.h" #include "jingle/notifier/communicator/login.h" #include "jingle/notifier/listener/notification_defines.h" @@ -65,7 +65,7 @@ class XmppPushClient : virtual void OnSubscriptionError() OVERRIDE; private: - base::NonThreadSafe non_thread_safe_; + base::ThreadChecker thread_checker_; const NotifierOptions notifier_options_; ObserverList<PushClientObserver> observers_; |