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

Unified Diff: jingle/notifier/base/xmpp_connection.cc

Issue 2088433002: Remove calls to MessageLoop::current() in jingle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/base/xmpp_connection.cc
diff --git a/jingle/notifier/base/xmpp_connection.cc b/jingle/notifier/base/xmpp_connection.cc
index d50adb027451839babb5e6ca53ac8519cc977603..8c321bcfd3f79027ba562ae5ccafe9c310d589d5 100644
--- a/jingle/notifier/base/xmpp_connection.cc
+++ b/jingle/notifier/base/xmpp_connection.cc
@@ -8,8 +8,8 @@
#include "base/compiler_specific.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
#include "base/strings/string_piece.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "jingle/glue/chrome_async_socket.h"
#include "jingle/glue/task_pump.h"
#include "jingle/glue/xmpp_client_socket_factory.h"
@@ -82,13 +82,13 @@ XmppConnection::~XmppConnection() {
DCHECK(CalledOnValidThread());
ClearClient();
task_pump_->Stop();
- base::MessageLoop* current_message_loop = base::MessageLoop::current();
- CHECK(current_message_loop);
// We do this because XmppConnection may get destroyed as a result
// of a signal from XmppClient. If we delete |task_pump_| here, bad
// things happen when the stack pops back up to the XmppClient's
// (which is deleted by |task_pump_|) function.
- current_message_loop->DeleteSoon(FROM_HERE, task_pump_.release());
+ CHECK(base::ThreadTaskRunnerHandle::IsSet());
Sergey Ulanov 2016/06/20 22:53:25 I don't think you need this CHECK(). There is DCHE
fdoray 2016/06/21 13:01:51 Done.
+ base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE,
+ task_pump_.release());
}
void XmppConnection::OnStateChange(buzz::XmppEngine::State state) {
« jingle/glue/proxy_resolving_client_socket.cc ('K') | « jingle/glue/proxy_resolving_client_socket.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698