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

Unified Diff: remoting/host/heartbeat_sender.h

Issue 9004050: Move signaling connection creation out of ChromotingHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years 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: remoting/host/heartbeat_sender.h
diff --git a/remoting/host/heartbeat_sender.h b/remoting/host/heartbeat_sender.h
index 63c9576621391a079e9902b1597d94e59747e78a..952c8fbcd6d2ba889ed3a5ed2a3de0dd8535d263 100644
--- a/remoting/host/heartbeat_sender.h
+++ b/remoting/host/heartbeat_sender.h
@@ -8,12 +8,12 @@
#include <string>
#include "base/compiler_specific.h"
+#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/timer.h"
#include "remoting/host/host_key_pair.h"
-#include "remoting/host/host_status_observer.h"
-#include "base/gtest_prod_util.h"
+#include "remoting/jingle_glue/signal_strategy.h"
namespace base {
class MessageLoopProxy;
@@ -64,23 +64,19 @@ class MutableHostConfig;
// server.
//
// TODO(sergeyu): Is it enough to sign JID and nothing else?
Wez 2012/01/03 16:25:04 nit: Consider creating a bug for this, or removing
Sergey Ulanov 2012/01/03 21:51:02 Just removed it.
-class HeartbeatSender : public HostStatusObserver {
+class HeartbeatSender : public SignalStrategy::Listener {
public:
- HeartbeatSender(base::MessageLoopProxy* main_loop,
- MutableHostConfig* config);
+ HeartbeatSender();
virtual ~HeartbeatSender();
- // Initializes heart-beating for |jingle_client_| with |config_|. Returns
- // false if the config is invalid (e.g. private key cannot be parsed).
- bool Init();
+ // Initializes heartbeating. Returns false if the |config| is
Wez 2012/01/03 16:25:04 nit: Initializes the HeartbeatSender. Heartbeats
Sergey Ulanov 2012/01/03 21:51:02 Done.
+ // invalid (e.g. private key cannot be parsed). SignalStrategy must
+ // outlive this object.
Wez 2012/01/03 16:25:04 HeartbeatSender must now be initialized and delete
Sergey Ulanov 2012/01/03 21:51:02 Not yet in this CL - they are still initialized on
+ bool Init(SignalStrategy* signal_strategy, MutableHostConfig* config);
- // HostStatusObserver implementation.
- virtual void OnSignallingConnected(SignalStrategy* signal_strategy) OVERRIDE;
- virtual void OnSignallingDisconnected() OVERRIDE;
- virtual void OnClientAuthenticated(const std::string& jid) OVERRIDE;
- virtual void OnClientDisconnected(const std::string& jid) OVERRIDE;
- virtual void OnAccessDenied() OVERRIDE;
- virtual void OnShutdown() OVERRIDE;
+ // SignalStrategy::Listener interface.
+ virtual void OnSignalStrategyStateChange(
+ SignalStrategy::State state) OVERRIDE;
private:
FRIEND_TEST_ALL_PREFIXES(HeartbeatSenderTest, DoSendStanza);
@@ -104,11 +100,9 @@ class HeartbeatSender : public HostStatusObserver {
buzz::XmlElement* CreateSignature();
State state_;
- scoped_refptr<base::MessageLoopProxy> message_loop_;
- scoped_refptr<MutableHostConfig> config_;
+ SignalStrategy* signal_strategy_;
std::string host_id_;
HostKeyPair key_pair_;
- std::string full_jid_;
scoped_ptr<IqSender> iq_sender_;
scoped_ptr<IqRequest> request_;
int interval_ms_;

Powered by Google App Engine
This is Rietveld 408576698