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

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

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
Index: jingle/notifier/listener/mediator_thread_impl.h
diff --git a/jingle/notifier/listener/mediator_thread_impl.h b/jingle/notifier/listener/mediator_thread_impl.h
index 4015a81f64a4d9c4539c637f4dfffd838a8a3d6c..06567578fc3bc315175bf70724eec661da2a654a 100644
--- a/jingle/notifier/listener/mediator_thread_impl.h
+++ b/jingle/notifier/listener/mediator_thread_impl.h
@@ -25,6 +25,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
#include "base/task.h"
#include "jingle/notifier/base/notifier_options.h"
#include "jingle/notifier/listener/mediator_thread.h"
@@ -37,6 +38,10 @@ namespace buzz {
class XmppClientSettings;
} // namespace buzz
+namespace talk_base {
+class Task;
+} // namespace talk_base
+
namespace notifier {
class MediatorThreadImpl : public MediatorThread {
@@ -59,6 +64,11 @@ class MediatorThreadImpl : public MediatorThread {
virtual void SendNotification(const Notification& data);
virtual void UpdateXmppSettings(const buzz::XmppClientSettings& settings);
+ // Used by unit tests. Make sure that tests that use this have the
+ // IO message loop proxy passed in via |notifier_options| pointing
+ // to the current thread.
+ void TriggerOnConnectForTest(base::WeakPtr<talk_base::Task> base_task);
+
private:
void CheckOrSetValidThread();
// The logic of Logout without the thread check so it can be called in the
« no previous file with comments | « jingle/notifier/base/proxy_resolving_client_socket_unittest.cc ('k') | jingle/notifier/listener/mediator_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698