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

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

Issue 6794005: Move sync notifier contruction out of syncer thread. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase 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/mediator_thread_impl.cc ('k') | jingle/notifier/listener/talk_mediator_impl.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.h
diff --git a/jingle/notifier/listener/talk_mediator_impl.h b/jingle/notifier/listener/talk_mediator_impl.h
index 5ae0030ef25a7e43bc4e283073fe9b2233de6f8a..d563ed02fb3cb42761815c67791445712537766c 100644
--- a/jingle/notifier/listener/talk_mediator_impl.h
+++ b/jingle/notifier/listener/talk_mediator_impl.h
@@ -20,6 +20,8 @@
#include "jingle/notifier/listener/talk_mediator.h"
#include "talk/xmpp/xmppclientsettings.h"
+class MessageLoop;
+
namespace notifier {
class TalkMediatorImpl
@@ -36,13 +38,18 @@ class TalkMediatorImpl
// TalkMediator implementation.
+ // Should be called on the same thread as the constructor.
virtual void SetDelegate(TalkMediator::Delegate* delegate);
+ // All the methods below should be called on the same thread. It may or may
+ // not be same as the thread on which the object was constructed.
+
// |email| must be a valid email address (e.g., foo@bar.com).
virtual void SetAuthToken(const std::string& email,
const std::string& token,
const std::string& token_service);
virtual bool Login();
+ // Users must call Logout once Login is called.
virtual bool Logout();
virtual bool SendNotification(const Notification& data);
@@ -74,7 +81,7 @@ class TalkMediatorImpl
unsigned int subscribed : 1; // Subscribed to the xmpp receiving channel.
};
- base::NonThreadSafe non_thread_safe_;
+ void CheckOrSetValidThread();
// Delegate, which we don't own. May be NULL.
TalkMediator::Delegate* delegate_;
@@ -92,6 +99,9 @@ class TalkMediatorImpl
SubscriptionList subscriptions_;
+ MessageLoop* construction_message_loop_;
+ MessageLoop* method_message_loop_;
+
FRIEND_TEST_ALL_PREFIXES(TalkMediatorImplTest, SetAuthToken);
FRIEND_TEST_ALL_PREFIXES(TalkMediatorImplTest, SendNotification);
FRIEND_TEST_ALL_PREFIXES(TalkMediatorImplTest, MediatorThreadCallbacks);
« no previous file with comments | « jingle/notifier/listener/mediator_thread_impl.cc ('k') | jingle/notifier/listener/talk_mediator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698