summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 21:17:17 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 21:17:17 +0000
commita7ed4b899726bb4fb7a806b9fbbb2e166c7db659 (patch)
tree5cca8af58867d15191d516fd0865ce077d48cb1f /remoting
parent950c3b3d1d0cb93b6ddcea6aaf9646b8842a5506 (diff)
downloadchromium_src-a7ed4b899726bb4fb7a806b9fbbb2e166c7db659.zip
chromium_src-a7ed4b899726bb4fb7a806b9fbbb2e166c7db659.tar.gz
chromium_src-a7ed4b899726bb4fb7a806b9fbbb2e166c7db659.tar.bz2
Don't use MessageLoop and MessageLoopProxy in remoting/jingle_glue
MessageLoopProxy::current() may not work properly on plugin threads unless the plugin is compiled into the browser. BUG=134216 Review URL: https://chromiumcodereview.appspot.com/10830017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148811 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/jingle_glue/fake_signal_strategy.cc6
-rw-r--r--remoting/jingle_glue/iq_sender.cc10
2 files changed, 9 insertions, 7 deletions
diff --git a/remoting/jingle_glue/fake_signal_strategy.cc b/remoting/jingle_glue/fake_signal_strategy.cc
index 1ddabda..c489098 100644
--- a/remoting/jingle_glue/fake_signal_strategy.cc
+++ b/remoting/jingle_glue/fake_signal_strategy.cc
@@ -5,10 +5,12 @@
#include "remoting/jingle_glue/fake_signal_strategy.h"
#include "base/bind.h"
+#include "base/location.h"
#include "base/logging.h"
-#include "base/message_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
#include "third_party/libjingle/source/talk/xmpp/constants.h"
@@ -93,7 +95,7 @@ void FakeSignalStrategy::OnIncomingMessage(
scoped_ptr<buzz::XmlElement> stanza) {
pending_messages_.push(stanza.get());
received_messages_.push_back(stanza.release());
- MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&FakeSignalStrategy::DeliverIncomingMessages,
weak_factory_.GetWeakPtr()));
}
diff --git a/remoting/jingle_glue/iq_sender.cc b/remoting/jingle_glue/iq_sender.cc
index 797db2a..aa88ec7 100644
--- a/remoting/jingle_glue/iq_sender.cc
+++ b/remoting/jingle_glue/iq_sender.cc
@@ -8,8 +8,9 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop_proxy.h"
+#include "base/single_thread_task_runner.h"
#include "base/string_number_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "base/time.h"
#include "remoting/jingle_glue/signal_strategy.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
@@ -145,9 +146,8 @@ IqRequest::~IqRequest() {
}
void IqRequest::SetTimeout(base::TimeDelta timeout) {
- base::MessageLoopProxy::current()->PostDelayedTask(
- FROM_HERE, base::Bind(&IqRequest::OnTimeout, AsWeakPtr()),
- timeout);
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&IqRequest::OnTimeout, AsWeakPtr()), timeout);
}
void IqRequest::CallCallback(const buzz::XmlElement* stanza) {
@@ -166,7 +166,7 @@ void IqRequest::OnResponse(const buzz::XmlElement* stanza) {
// It's unsafe to delete signal strategy here, and the callback may
// want to do that, so we post task to invoke the callback later.
scoped_ptr<buzz::XmlElement> stanza_copy(new buzz::XmlElement(*stanza));
- base::MessageLoopProxy::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&IqRequest::DeliverResponse, AsWeakPtr(),
base::Passed(&stanza_copy)));
}