Index: jingle/notifier/listener/xmpp_push_client.cc |
diff --git a/jingle/notifier/listener/xmpp_push_client.cc b/jingle/notifier/listener/xmpp_push_client.cc |
index 9b4811e754ccda1ef5e20adc6863a683d34cc29a..f1e00033ab62d2cea02dcb7face16ceb9dd79e2d 100644 |
--- a/jingle/notifier/listener/xmpp_push_client.cc |
+++ b/jingle/notifier/listener/xmpp_push_client.cc |
@@ -8,6 +8,7 @@ |
#include "base/message_loop_proxy.h" |
#include "jingle/notifier/base/notifier_options_util.h" |
#include "jingle/notifier/listener/push_client_observer.h" |
+#include "jingle/notifier/listener/send_ping_task.h" |
#include "jingle/notifier/listener/push_notifications_send_update_task.h" |
namespace notifier { |
@@ -80,6 +81,11 @@ void XmppPushClient::OnNotificationReceived( |
OnIncomingNotification(notification)); |
} |
+void XmppPushClient::OnPingResponseReceived() { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ FOR_EACH_OBSERVER(PushClientObserver, observers_, OnPingResponse()); |
+} |
+ |
void XmppPushClient::OnSubscribed() { |
DCHECK(thread_checker_.CalledOnValidThread()); |
FOR_EACH_OBSERVER(PushClientObserver, observers_, |
@@ -143,4 +149,15 @@ void XmppPushClient::SendNotification(const Notification& notification) { |
task->Start(); |
} |
+void XmppPushClient::SendPing() { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ if (!base_task_.get()) { |
+ DVLOG(1) << "Push: Cannot send ping"; |
+ return; |
+ } |
+ // Owned by |base_task_|. |
+ SendPingTask* task = new SendPingTask(base_task_); |
+ task->Start(); |
+} |
+ |
} // namespace notifier |