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

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

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: comments addressed 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/send_ping_task.h
diff --git a/jingle/notifier/listener/send_ping_task.h b/jingle/notifier/listener/send_ping_task.h
new file mode 100644
index 0000000000000000000000000000000000000000..9cd8b2282392e70ed9b781f99434d973aab3fc36
--- /dev/null
+++ b/jingle/notifier/listener/send_ping_task.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Methods for sending the update stanza to notify peers via xmpp.
+
+#ifndef JINGLE_NOTIFIER_LISTENER_SEND_PING_TASK_H_
+#define JINGLE_NOTIFIER_LISTENER_SEND_PING_TASK_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/gtest_prod_util.h"
+#include "talk/xmpp/xmpptask.h"
+
+namespace buzz {
+class XmlElement;
+} // namespace
+
+namespace notifier {
+
+class SendPingTask : public buzz::XmppTask {
+ public:
+ class Delegate {
+ public:
+ virtual void OnPingResponseReceived() = 0;
+
+ protected:
+ virtual ~Delegate();
+ };
+
+ SendPingTask(buzz::XmppTaskParentInterface* parent, Delegate* delegate);
+ virtual ~SendPingTask();
+
+ // Overridden from buzz::XmppTask.
+ virtual int ProcessStart() OVERRIDE;
+ virtual int ProcessResponse() OVERRIDE;
+ virtual bool HandleStanza(const buzz::XmlElement* stanza) OVERRIDE;
+
+ private:
+ static buzz::XmlElement* MakePingStanza(const std::string& task_id);
+
+ FRIEND_TEST_ALL_PREFIXES(SendPingTaskTest, MakePingStanza);
+
+ std::string ping_task_id_;
+ Delegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(SendPingTask);
+};
+
+typedef SendPingTask::Delegate SendPingTaskDelegate;
+
+} // namespace notifier
+
+#endif // JINGLE_NOTIFIER_LISTENER_SEND_PING_TASK_H_
« no previous file with comments | « jingle/notifier/listener/push_notifications_send_update_task.cc ('k') | jingle/notifier/listener/send_ping_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698