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

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

Issue 11232048: Adding XMPP ping functionality to CLoudPrint. XMPP ping and timeout is controlled thorugh Service S… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added missing files Created 8 years, 2 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/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
« jingle/notifier/listener/send_ping_task.cc ('K') | « jingle/notifier/listener/xmpp_push_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698