summaryrefslogtreecommitdiffstats
path: root/jingle
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-08 22:27:18 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-08 22:27:18 +0000
commit791fecafd19065160d0d546e497c8af1d0e1692a (patch)
treeed0afeb0ce3b32cccb7ad9e1016ddb6f8ec785aa /jingle
parentd85ef76db127b1f1dfb1cac438aa1df69a24687d (diff)
downloadchromium_src-791fecafd19065160d0d546e497c8af1d0e1692a.zip
chromium_src-791fecafd19065160d0d546e497c8af1d0e1692a.tar.gz
chromium_src-791fecafd19065160d0d546e497c8af1d0e1692a.tar.bz2
Update libjingle to the latest version.
BUG=None TEST=Unittests Review URL: http://codereview.chromium.org/7795059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
-rw-r--r--jingle/glue/thread_wrapper.cc3
-rw-r--r--jingle/notifier/base/fake_base_task.cc2
-rw-r--r--jingle/notifier/base/fake_base_task.h10
-rw-r--r--jingle/notifier/base/xmpp_connection.h8
-rw-r--r--jingle/notifier/base/xmpp_connection_unittest.cc2
-rw-r--r--jingle/notifier/communicator/login.cc2
-rw-r--r--jingle/notifier/communicator/login.h12
-rw-r--r--jingle/notifier/communicator/single_login_attempt.cc3
-rw-r--r--jingle/notifier/communicator/single_login_attempt.h11
-rw-r--r--jingle/notifier/listener/mediator_thread_impl.cc9
-rw-r--r--jingle/notifier/listener/mediator_thread_impl.h4
-rw-r--r--jingle/notifier/listener/mediator_thread_unittest.cc2
-rw-r--r--jingle/notifier/listener/push_notifications_listen_task.cc3
-rw-r--r--jingle/notifier/listener/push_notifications_listen_task.h4
-rw-r--r--jingle/notifier/listener/push_notifications_send_update_task.cc2
-rw-r--r--jingle/notifier/listener/push_notifications_send_update_task.h2
-rw-r--r--jingle/notifier/listener/push_notifications_subscribe_task.cc3
-rw-r--r--jingle/notifier/listener/push_notifications_subscribe_task.h7
18 files changed, 45 insertions, 44 deletions
diff --git a/jingle/glue/thread_wrapper.cc b/jingle/glue/thread_wrapper.cc
index 6983087..4a47e5d 100644
--- a/jingle/glue/thread_wrapper.cc
+++ b/jingle/glue/thread_wrapper.cc
@@ -49,6 +49,8 @@ JingleThreadWrapper::JingleThreadWrapper(MessageLoop* message_loop)
talk_base::ThreadManager::SetCurrent(this);
talk_base::MessageQueueManager::Instance()->Add(this);
message_loop_->AddDestructionObserver(this);
+
+ WrapCurrent();
}
JingleThreadWrapper::~JingleThreadWrapper() {
@@ -56,6 +58,7 @@ JingleThreadWrapper::~JingleThreadWrapper() {
void JingleThreadWrapper::WillDestroyCurrentMessageLoop() {
DCHECK_EQ(talk_base::Thread::Current(), current());
+ UnwrapCurrent();
g_jingle_thread_wrapper.Get().Set(NULL);
talk_base::ThreadManager::SetCurrent(NULL);
talk_base::MessageQueueManager::Instance()->Remove(this);
diff --git a/jingle/notifier/base/fake_base_task.cc b/jingle/notifier/base/fake_base_task.cc
index 694bac0..9dceec0 100644
--- a/jingle/notifier/base/fake_base_task.cc
+++ b/jingle/notifier/base/fake_base_task.cc
@@ -45,7 +45,7 @@ FakeBaseTask::FakeBaseTask() {
FakeBaseTask::~FakeBaseTask() {}
-base::WeakPtr<talk_base::Task> FakeBaseTask::AsWeakPtr() {
+base::WeakPtr<buzz::XmppTaskParentInterface> FakeBaseTask::AsWeakPtr() {
return base_task_;
}
diff --git a/jingle/notifier/base/fake_base_task.h b/jingle/notifier/base/fake_base_task.h
index 2efc40e..c39e3f3 100644
--- a/jingle/notifier/base/fake_base_task.h
+++ b/jingle/notifier/base/fake_base_task.h
@@ -13,9 +13,9 @@
#include "base/memory/weak_ptr.h"
#include "jingle/notifier/base/task_pump.h"
-namespace talk_base {
-class Task;
-} // namespace talk_base
+namespace buzz {
+class XmppTaskParentInterface;
+} // namespace buzz
namespace notifier {
@@ -24,11 +24,11 @@ class FakeBaseTask {
FakeBaseTask();
~FakeBaseTask();
- base::WeakPtr<talk_base::Task> AsWeakPtr();
+ base::WeakPtr<buzz::XmppTaskParentInterface> AsWeakPtr();
private:
notifier::TaskPump task_pump_;
- base::WeakPtr<talk_base::Task> base_task_;
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task_;
DISALLOW_COPY_AND_ASSIGN(FakeBaseTask);
};
diff --git a/jingle/notifier/base/xmpp_connection.h b/jingle/notifier/base/xmpp_connection.h
index 278a6a2..9f142b1 100644
--- a/jingle/notifier/base/xmpp_connection.h
+++ b/jingle/notifier/base/xmpp_connection.h
@@ -22,10 +22,7 @@ namespace buzz {
class PreXmppAuth;
class XmlElement;
class XmppClientSettings;
-} // namespace
-
-namespace talk_base {
-class Task;
+class XmppTaskParentInterface;
} // namespace
namespace notifier {
@@ -42,7 +39,8 @@ class XmppConnection : public sigslot::has_slots<> {
// Called (at most once) when a connection has been established.
// |base_task| can be used by the client as the parent of any Task
// it creates as long as it is valid (i.e., non-NULL).
- virtual void OnConnect(base::WeakPtr<talk_base::Task> base_task) = 0;
+ virtual void OnConnect(
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task) = 0;
// Called if an error has occurred (either before or after a call
// to OnConnect()). No calls to the delegate will be made after
diff --git a/jingle/notifier/base/xmpp_connection_unittest.cc b/jingle/notifier/base/xmpp_connection_unittest.cc
index 4e1baa3..e2c88cd 100644
--- a/jingle/notifier/base/xmpp_connection_unittest.cc
+++ b/jingle/notifier/base/xmpp_connection_unittest.cc
@@ -89,7 +89,7 @@ class MockXmppConnectionDelegate : public XmppConnection::Delegate {
public:
virtual ~MockXmppConnectionDelegate() {}
- MOCK_METHOD1(OnConnect, void(base::WeakPtr<talk_base::Task>));
+ MOCK_METHOD1(OnConnect, void(base::WeakPtr<buzz::XmppTaskParentInterface>));
MOCK_METHOD3(OnError,
void(buzz::XmppEngine::Error, int, const buzz::XmlElement*));
};
diff --git a/jingle/notifier/communicator/login.cc b/jingle/notifier/communicator/login.cc
index 70d3700..bc960b5 100644
--- a/jingle/notifier/communicator/login.cc
+++ b/jingle/notifier/communicator/login.cc
@@ -76,7 +76,7 @@ void Login::UpdateXmppSettings(const buzz::XmppClientSettings& user_settings) {
*(login_settings_->modifiable_user_settings()) = user_settings;
}
-void Login::OnConnect(base::WeakPtr<talk_base::Task> base_task) {
+void Login::OnConnect(base::WeakPtr<buzz::XmppTaskParentInterface> base_task) {
ResetReconnectState();
delegate_->OnConnect(base_task);
}
diff --git a/jingle/notifier/communicator/login.h b/jingle/notifier/communicator/login.h
index 8c2530c..c2da86f 100644
--- a/jingle/notifier/communicator/login.h
+++ b/jingle/notifier/communicator/login.h
@@ -21,17 +21,13 @@ namespace buzz {
class XmppClient;
class XmppEngine;
class XmppClientSettings;
+class XmppTaskParentInterface;
} // namespace buzz
namespace net {
class URLRequestContextGetter;
} // namespace net
-namespace talk_base {
-class Task;
-class TaskParent;
-} // namespace talk_base
-
namespace notifier {
class ConnectionOptions;
@@ -51,7 +47,8 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver,
public:
virtual ~Delegate() {}
- virtual void OnConnect(base::WeakPtr<talk_base::Task> base_task) = 0;
+ virtual void OnConnect(
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task) = 0;
virtual void OnDisconnect() = 0;
};
@@ -76,7 +73,8 @@ class Login : public net::NetworkChangeNotifier::IPAddressObserver,
virtual void OnIPAddressChanged();
// SingleLoginAttempt::Delegate implementation.
- virtual void OnConnect(base::WeakPtr<talk_base::Task> base_task);
+ virtual void OnConnect(
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task);
virtual void OnNeedReconnect();
virtual void OnRedirect(const std::string& redirect_server,
int redirect_port);
diff --git a/jingle/notifier/communicator/single_login_attempt.cc b/jingle/notifier/communicator/single_login_attempt.cc
index 21ab68e..3088f6e 100644
--- a/jingle/notifier/communicator/single_login_attempt.cc
+++ b/jingle/notifier/communicator/single_login_attempt.cc
@@ -49,7 +49,8 @@ SingleLoginAttempt::SingleLoginAttempt(LoginSettings* login_settings,
SingleLoginAttempt::~SingleLoginAttempt() {}
-void SingleLoginAttempt::OnConnect(base::WeakPtr<talk_base::Task> base_task) {
+void SingleLoginAttempt::OnConnect(
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task) {
delegate_->OnConnect(base_task);
}
diff --git a/jingle/notifier/communicator/single_login_attempt.h b/jingle/notifier/communicator/single_login_attempt.h
index 693c341..8960767 100644
--- a/jingle/notifier/communicator/single_login_attempt.h
+++ b/jingle/notifier/communicator/single_login_attempt.h
@@ -12,9 +12,9 @@
#include "jingle/notifier/communicator/xmpp_connection_generator.h"
#include "talk/xmpp/xmppengine.h"
-namespace talk_base {
-class Task;
-}
+namespace buzz {
+class XmppTaskParentInterface;
+} // namespace buzz
namespace notifier {
@@ -32,7 +32,8 @@ class SingleLoginAttempt : public XmppConnection::Delegate,
public:
virtual ~Delegate() {}
- virtual void OnConnect(base::WeakPtr<talk_base::Task> base_task) = 0;
+ virtual void OnConnect(
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task) = 0;
virtual void OnNeedReconnect() = 0;
virtual void OnRedirect(const std::string& redirect_server,
int redirect_port) = 0;
@@ -45,7 +46,7 @@ class SingleLoginAttempt : public XmppConnection::Delegate,
virtual ~SingleLoginAttempt();
// XmppConnection::Delegate implementation.
- virtual void OnConnect(base::WeakPtr<talk_base::Task> parent);
+ virtual void OnConnect(base::WeakPtr<buzz::XmppTaskParentInterface> parent);
virtual void OnError(buzz::XmppEngine::Error error,
int error_subcode,
const buzz::XmlElement* stream_error);
diff --git a/jingle/notifier/listener/mediator_thread_impl.cc b/jingle/notifier/listener/mediator_thread_impl.cc
index b5468de..6e89ed6 100644
--- a/jingle/notifier/listener/mediator_thread_impl.cc
+++ b/jingle/notifier/listener/mediator_thread_impl.cc
@@ -38,7 +38,8 @@ class MediatorThreadImpl::Core
void RemoveObserver(Observer* observer);
// Login::Delegate implementation. Called on I/O thread.
- virtual void OnConnect(base::WeakPtr<talk_base::Task> base_task);
+ virtual void OnConnect(
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task);
virtual void OnDisconnect();
// PushNotificationsListenTaskDelegate implementation. Called on I/O thread.
@@ -63,7 +64,7 @@ class MediatorThreadImpl::Core
// Invoked on either the caller thread or the I/O thread.
virtual ~Core();
scoped_refptr<ObserverListThreadSafe<Observer> > observers_;
- base::WeakPtr<talk_base::Task> base_task_;
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task_;
const NotifierOptions notifier_options_;
@@ -187,7 +188,7 @@ void MediatorThreadImpl::Core::UpdateXmppSettings(
}
void MediatorThreadImpl::Core::OnConnect(
- base::WeakPtr<talk_base::Task> base_task) {
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task) {
DCHECK(notifier_options_.request_context_getter->GetIOMessageLoopProxy()->
BelongsToCurrentThread());
base_task_ = base_task;
@@ -291,7 +292,7 @@ void MediatorThreadImpl::UpdateXmppSettings(
}
void MediatorThreadImpl::TriggerOnConnectForTest(
- base::WeakPtr<talk_base::Task> base_task) {
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task) {
DCHECK(parent_message_loop_proxy_->BelongsToCurrentThread());
io_message_loop_proxy_->PostTask(
FROM_HERE,
diff --git a/jingle/notifier/listener/mediator_thread_impl.h b/jingle/notifier/listener/mediator_thread_impl.h
index ab85ccd..4afac17 100644
--- a/jingle/notifier/listener/mediator_thread_impl.h
+++ b/jingle/notifier/listener/mediator_thread_impl.h
@@ -36,6 +36,7 @@ class MessageLoopProxy;
namespace buzz {
class XmppClientSettings;
+class XmppTaskParentInterface;
} // namespace buzz
namespace talk_base {
@@ -67,7 +68,8 @@ class MediatorThreadImpl : public MediatorThread {
// 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);
+ void TriggerOnConnectForTest(
+ base::WeakPtr<buzz::XmppTaskParentInterface> base_task);
private:
// The logic of Logout without the thread check so it can be called in the
diff --git a/jingle/notifier/listener/mediator_thread_unittest.cc b/jingle/notifier/listener/mediator_thread_unittest.cc
index 6b01aa5..1d6767f 100644
--- a/jingle/notifier/listener/mediator_thread_unittest.cc
+++ b/jingle/notifier/listener/mediator_thread_unittest.cc
@@ -116,7 +116,7 @@ TEST_F(MediatorThreadTest, SendNotificationDelayedTwice) {
mediator_thread_->SendNotification(Notification());
}
mediator_thread_->TriggerOnConnectForTest(
- base::WeakPtr<talk_base::Task>());
+ base::WeakPtr<buzz::XmppTaskParentInterface>());
mediator_thread_->TriggerOnConnectForTest(fake_base_task_.AsWeakPtr());
}
diff --git a/jingle/notifier/listener/push_notifications_listen_task.cc b/jingle/notifier/listener/push_notifications_listen_task.cc
index 328bbe2..3a665ee 100644
--- a/jingle/notifier/listener/push_notifications_listen_task.cc
+++ b/jingle/notifier/listener/push_notifications_listen_task.cc
@@ -19,7 +19,7 @@
namespace notifier {
PushNotificationsListenTask::PushNotificationsListenTask(
- Task* parent, Delegate* delegate)
+ buzz::XmppTaskParentInterface* parent, Delegate* delegate)
: buzz::XmppTask(parent, buzz::XmppEngine::HL_TYPE),
delegate_(delegate) {
DCHECK(delegate_);
@@ -97,4 +97,3 @@ bool PushNotificationsListenTask::IsValidNotification(
}
} // namespace notifier
-
diff --git a/jingle/notifier/listener/push_notifications_listen_task.h b/jingle/notifier/listener/push_notifications_listen_task.h
index 3cc4c3d..fa6f3ae 100644
--- a/jingle/notifier/listener/push_notifications_listen_task.h
+++ b/jingle/notifier/listener/push_notifications_listen_task.h
@@ -32,7 +32,8 @@ class PushNotificationsListenTask : public buzz::XmppTask {
const Notification& notification) = 0;
};
- PushNotificationsListenTask(Task* parent, Delegate* delegate);
+ PushNotificationsListenTask(buzz::XmppTaskParentInterface* parent,
+ Delegate* delegate);
virtual ~PushNotificationsListenTask();
// Overriden from buzz::XmppTask.
@@ -54,4 +55,3 @@ typedef PushNotificationsListenTask::Delegate
} // namespace notifier
#endif // JINGLE_NOTIFIER_PUSH_NOTIFICATIONS_LISTENER_LISTEN_TASK_H_
-
diff --git a/jingle/notifier/listener/push_notifications_send_update_task.cc b/jingle/notifier/listener/push_notifications_send_update_task.cc
index 5cef1b5..6412319 100644
--- a/jingle/notifier/listener/push_notifications_send_update_task.cc
+++ b/jingle/notifier/listener/push_notifications_send_update_task.cc
@@ -20,7 +20,7 @@
namespace notifier {
PushNotificationsSendUpdateTask::PushNotificationsSendUpdateTask(
- TaskParent* parent, const Notification& notification)
+ buzz::XmppTaskParentInterface* parent, const Notification& notification)
: XmppTask(parent), notification_(notification) {}
PushNotificationsSendUpdateTask::~PushNotificationsSendUpdateTask() {}
diff --git a/jingle/notifier/listener/push_notifications_send_update_task.h b/jingle/notifier/listener/push_notifications_send_update_task.h
index 40aa7dc..7e1a938 100644
--- a/jingle/notifier/listener/push_notifications_send_update_task.h
+++ b/jingle/notifier/listener/push_notifications_send_update_task.h
@@ -22,7 +22,7 @@ namespace notifier {
class PushNotificationsSendUpdateTask : public buzz::XmppTask {
public:
PushNotificationsSendUpdateTask(
- TaskParent* parent, const Notification& notification);
+ buzz::XmppTaskParentInterface* parent, const Notification& notification);
virtual ~PushNotificationsSendUpdateTask();
// Overridden from buzz::XmppTask.
diff --git a/jingle/notifier/listener/push_notifications_subscribe_task.cc b/jingle/notifier/listener/push_notifications_subscribe_task.cc
index d8453ca..778e7fa 100644
--- a/jingle/notifier/listener/push_notifications_subscribe_task.cc
+++ b/jingle/notifier/listener/push_notifications_subscribe_task.cc
@@ -19,7 +19,7 @@
namespace notifier {
PushNotificationsSubscribeTask::PushNotificationsSubscribeTask(
- TaskParent* parent,
+ buzz::XmppTaskParentInterface* parent,
const SubscriptionList& subscriptions,
Delegate* delegate)
: XmppTask(parent, buzz::XmppEngine::HL_SINGLE),
@@ -108,4 +108,3 @@ buzz::XmlElement* PushNotificationsSubscribeTask::MakeSubscriptionMessage(
}
} // namespace notifier
-
diff --git a/jingle/notifier/listener/push_notifications_subscribe_task.h b/jingle/notifier/listener/push_notifications_subscribe_task.h
index 8dd4699..edd65d8 100644
--- a/jingle/notifier/listener/push_notifications_subscribe_task.h
+++ b/jingle/notifier/listener/push_notifications_subscribe_task.h
@@ -25,9 +25,9 @@ class PushNotificationsSubscribeTask : public buzz::XmppTask {
virtual void OnSubscriptionError() = 0;
};
- PushNotificationsSubscribeTask(TaskParent* parent,
- const SubscriptionList& subscriptions,
- Delegate* delegate);
+ PushNotificationsSubscribeTask(buzz::XmppTaskParentInterface* parent,
+ const SubscriptionList& subscriptions,
+ Delegate* delegate);
virtual ~PushNotificationsSubscribeTask();
// Overridden from XmppTask.
@@ -57,4 +57,3 @@ typedef PushNotificationsSubscribeTask::Delegate
} // namespace notifier
#endif // JINGLE_NOTIFIER_LISTENER_PUSH_NOTIFICATIONS_SUBSCRIBE_TASK_H_
-