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

Unified Diff: remoting/host/heartbeat_sender.cc

Issue 7633009: Use MessageLoopProxy for network message loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 4 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/heartbeat_sender.h ('k') | remoting/host/heartbeat_sender_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/heartbeat_sender.cc
diff --git a/remoting/host/heartbeat_sender.cc b/remoting/host/heartbeat_sender.cc
index f22486c8bac63e0c0af095bf45a5e3345c0c42fe..af739b0930e5be1acd21584d71d6f248db07cf7b 100644
--- a/remoting/host/heartbeat_sender.cc
+++ b/remoting/host/heartbeat_sender.cc
@@ -5,7 +5,7 @@
#include "remoting/host/heartbeat_sender.h"
#include "base/logging.h"
-#include "base/message_loop.h"
+#include "base/message_loop_proxy.h"
#include "base/string_number_conversions.h"
#include "base/time.h"
#include "remoting/base/constants.h"
@@ -33,7 +33,7 @@ const char kSetIntervalTag[] = "set-interval";
const int64 kDefaultHeartbeatIntervalMs = 5 * 60 * 1000; // 5 minutes.
}
-HeartbeatSender::HeartbeatSender(MessageLoop* message_loop,
+HeartbeatSender::HeartbeatSender(base::MessageLoopProxy* message_loop,
MutableHostConfig* config)
: state_(CREATED),
@@ -66,7 +66,7 @@ bool HeartbeatSender::Init() {
void HeartbeatSender::OnSignallingConnected(SignalStrategy* signal_strategy,
const std::string& full_jid) {
- DCHECK_EQ(MessageLoop::current(), message_loop_);
+ DCHECK(message_loop_->BelongsToCurrentThread());
DCHECK(state_ == INITIALIZED || state_ == STOPPED);
state_ = STARTED;
@@ -80,7 +80,7 @@ void HeartbeatSender::OnSignallingConnected(SignalStrategy* signal_strategy,
}
void HeartbeatSender::OnSignallingDisconnected() {
- DCHECK_EQ(MessageLoop::current(), message_loop_);
+ DCHECK(message_loop_->BelongsToCurrentThread());
state_ = STOPPED;
request_.reset(NULL);
}
@@ -95,7 +95,7 @@ void HeartbeatSender::OnClientDisconnected(
void HeartbeatSender::OnShutdown() { }
void HeartbeatSender::DoSendStanza() {
- DCHECK_EQ(MessageLoop::current(), message_loop_);
+ DCHECK(message_loop_->BelongsToCurrentThread());
DCHECK_EQ(state_, STARTED);
VLOG(1) << "Sending heartbeat stanza to " << kChromotingBotJid;
@@ -103,7 +103,7 @@ void HeartbeatSender::DoSendStanza() {
}
void HeartbeatSender::ProcessResponse(const XmlElement* response) {
- DCHECK_EQ(MessageLoop::current(), message_loop_);
+ DCHECK(message_loop_->BelongsToCurrentThread());
std::string type = response->Attr(buzz::QN_TYPE);
if (type == buzz::STR_ERROR) {
« no previous file with comments | « remoting/host/heartbeat_sender.h ('k') | remoting/host/heartbeat_sender_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698