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

Unified Diff: jingle/notifier/listener/talk_mediator_impl.cc

Issue 6881042: [Sync] Fix race condition in P2PNotifier with sending notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 8 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
« no previous file with comments | « jingle/notifier/listener/talk_mediator_impl.h ('k') | jingle/notifier/listener/talk_mediator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: jingle/notifier/listener/talk_mediator_impl.cc
diff --git a/jingle/notifier/listener/talk_mediator_impl.cc b/jingle/notifier/listener/talk_mediator_impl.cc
index 5bd70dcbc9b08eb5bbc7c4b5e2e758cb54f896f6..5b90663184fda2712cc055fb7075e8d881f69580 100644
--- a/jingle/notifier/listener/talk_mediator_impl.cc
+++ b/jingle/notifier/listener/talk_mediator_impl.cc
@@ -45,7 +45,6 @@ bool TalkMediatorImpl::Logout() {
state_.started = 0;
state_.logging_in = 0;
state_.logged_in = 0;
- state_.subscribed = 0;
// We do not want to be called back during logout since we may be
// closing.
mediator_thread_->RemoveObserver(this);
@@ -55,13 +54,9 @@ bool TalkMediatorImpl::Logout() {
return false;
}
-bool TalkMediatorImpl::SendNotification(const Notification& data) {
+void TalkMediatorImpl::SendNotification(const Notification& data) {
CheckOrSetValidThread();
- if (state_.logged_in && state_.subscribed) {
- mediator_thread_->SendNotification(data);
- return true;
- }
- return false;
+ mediator_thread_->SendNotification(data);
}
void TalkMediatorImpl::SetDelegate(TalkMediator::Delegate* delegate) {
@@ -116,7 +111,6 @@ void TalkMediatorImpl::OnConnectionStateChange(bool logged_in) {
void TalkMediatorImpl::OnSubscriptionStateChange(bool subscribed) {
CheckOrSetValidThread();
- state_.subscribed = subscribed;
VLOG(1) << "P2P: " << (subscribed ? "subscribed" : "unsubscribed");
if (delegate_)
delegate_->OnNotificationStateChange(subscribed);
« no previous file with comments | « jingle/notifier/listener/talk_mediator_impl.h ('k') | jingle/notifier/listener/talk_mediator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698