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

Unified Diff: remoting/host/log_to_server.cc

Issue 12386035: Moving host status events monitoring to a separate interface (HostStatusMonitor). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « remoting/host/log_to_server.h ('k') | remoting/host/log_to_server_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/log_to_server.cc
diff --git a/remoting/host/log_to_server.cc b/remoting/host/log_to_server.cc
index f4830f6f192ed8b7c98feabc72fcc6568b14e505..017274c0b73694e1d28419581fbf62d6ca814eef 100644
--- a/remoting/host/log_to_server.cc
+++ b/remoting/host/log_to_server.cc
@@ -7,7 +7,7 @@
#include "base/bind.h"
#include "base/message_loop_proxy.h"
#include "remoting/base/constants.h"
-#include "remoting/host/chromoting_host.h"
+#include "remoting/host/host_status_monitor.h"
#include "remoting/host/server_log_entry.h"
#include "remoting/jingle_glue/iq_sender.h"
#include "remoting/jingle_glue/signal_strategy.h"
@@ -20,25 +20,25 @@ using buzz::XmlElement;
namespace remoting {
-LogToServer::LogToServer(ChromotingHost* host,
+LogToServer::LogToServer(base::WeakPtr<HostStatusMonitor> monitor,
ServerLogEntry::Mode mode,
SignalStrategy* signal_strategy,
const std::string& directory_bot_jid)
- : host_(host),
+ : monitor_(monitor),
mode_(mode),
signal_strategy_(signal_strategy),
directory_bot_jid_(directory_bot_jid) {
signal_strategy_->AddListener(this);
- // |host| may be NULL in tests.
- if (host_)
- host_->AddStatusObserver(this);
rmsousa 2013/03/01 01:41:06 Nit: now that it's a separate, much simpler class,
alexeypa (please no reviews) 2013/03/01 17:49:26 Done.
+ // |monitor_| may be NULL in tests.
+ if (monitor_)
+ monitor_->AddStatusObserver(this);
}
LogToServer::~LogToServer() {
signal_strategy_->RemoveListener(this);
- if (host_)
- host_->RemoveStatusObserver(this);
+ if (monitor_)
+ monitor_->RemoveStatusObserver(this);
}
void LogToServer::LogSessionStateChange(const std::string& jid,
« no previous file with comments | « remoting/host/log_to_server.h ('k') | remoting/host/log_to_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698