1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Methods for sending the update stanza to notify peers via xmpp.
7 #ifndef JINGLE_NOTIFIER_LISTENER_SEND_PING_TASK_H_
8 #define JINGLE_NOTIFIER_LISTENER_SEND_PING_TASK_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h"
13 #include "webrtc/libjingle/xmpp/xmpptask.h"
21 class SendPingTask
: public buzz::XmppTask
{
25 virtual void OnPingResponseReceived() = 0;
31 SendPingTask(buzz::XmppTaskParentInterface
* parent
, Delegate
* delegate
);
32 ~SendPingTask() override
;
34 // Overridden from buzz::XmppTask.
35 int ProcessStart() override
;
36 int ProcessResponse() override
;
37 bool HandleStanza(const buzz::XmlElement
* stanza
) override
;
40 static buzz::XmlElement
* MakePingStanza(const std::string
& task_id
);
42 FRIEND_TEST_ALL_PREFIXES(SendPingTaskTest
, MakePingStanza
);
44 std::string ping_task_id_
;
47 DISALLOW_COPY_AND_ASSIGN(SendPingTask
);
50 typedef SendPingTask::Delegate SendPingTaskDelegate
;
52 } // namespace notifier
54 #endif // JINGLE_NOTIFIER_LISTENER_SEND_PING_TASK_H_