summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chromeos/dbus/blocking_method_caller.cc1
-rw-r--r--chromeos/dbus/dbus_thread_manager.cc6
-rw-r--r--dbus/bus.cc56
-rw-r--r--dbus/bus.h49
-rw-r--r--dbus/bus_unittest.cc6
-rw-r--r--dbus/end_to_end_async_unittest.cc8
-rw-r--r--dbus/mock_bus.cc4
-rw-r--r--dbus/mock_bus.h2
-rw-r--r--dbus/property_unittest.cc6
-rw-r--r--dbus/signal_sender_verification_unittest.cc7
-rw-r--r--dbus/test_server.cc2
-rw-r--r--dbus/test_service.cc4
-rw-r--r--dbus/test_service.h8
-rw-r--r--device/media_transfer_protocol/media_transfer_protocol_manager.cc2
14 files changed, 78 insertions, 83 deletions
diff --git a/chromeos/dbus/blocking_method_caller.cc b/chromeos/dbus/blocking_method_caller.cc
index 5fc0c9a..3c288f1 100644
--- a/chromeos/dbus/blocking_method_caller.cc
+++ b/chromeos/dbus/blocking_method_caller.cc
@@ -5,6 +5,7 @@
#include "chromeos/dbus/blocking_method_caller.h"
#include "base/bind.h"
+#include "base/location.h"
#include "base/threading/thread_restrictions.h"
#include "dbus/bus.h"
#include "dbus/object_proxy.h"
diff --git a/chromeos/dbus/dbus_thread_manager.cc b/chromeos/dbus/dbus_thread_manager.cc
index 3c998c1..07ed761 100644
--- a/chromeos/dbus/dbus_thread_manager.cc
+++ b/chromeos/dbus/dbus_thread_manager.cc
@@ -72,8 +72,7 @@ class DBusThreadManagerImpl : public DBusThreadManager {
dbus::Bus::Options system_bus_options;
system_bus_options.bus_type = dbus::Bus::SYSTEM;
system_bus_options.connection_type = dbus::Bus::PRIVATE;
- system_bus_options.dbus_thread_message_loop_proxy =
- dbus_thread_->message_loop_proxy();
+ system_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
system_bus_ = new dbus::Bus(system_bus_options);
bluetooth_manager_client_.reset(BluetoothManagerClient::Create(
@@ -169,8 +168,7 @@ class DBusThreadManagerImpl : public DBusThreadManager {
ibus_bus_options.bus_type = dbus::Bus::CUSTOM_ADDRESS;
ibus_bus_options.address = ibus_address;
ibus_bus_options.connection_type = dbus::Bus::PRIVATE;
- ibus_bus_options.dbus_thread_message_loop_proxy =
- dbus_thread_->message_loop_proxy();
+ ibus_bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
ibus_bus_ = new dbus::Bus(ibus_bus_options);
ibus_address_ = ibus_address;
VLOG(1) << "Connected to ibus-daemon: " << ibus_address;
diff --git a/dbus/bus.cc b/dbus/bus.cc
index 30089ab..e895e58 100644
--- a/dbus/bus.cc
+++ b/dbus/bus.cc
@@ -13,7 +13,6 @@
#include "base/threading/thread_restrictions.h"
#include "base/time.h"
#include "dbus/exported_object.h"
-#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
#include "dbus/scoped_dbus_error.h"
@@ -30,7 +29,7 @@ const char kDisconnectedMatchRule[] =
// communication.
class Watch : public base::MessagePumpLibevent::Watcher {
public:
- Watch(DBusWatch* watch)
+ explicit Watch(DBusWatch* watch)
: raw_watch_(watch) {
dbus_watch_set_data(raw_watch_, this, NULL);
}
@@ -101,7 +100,7 @@ class Watch : public base::MessagePumpLibevent::Watcher {
// Bus::OnRemoveTimeout().
class Timeout : public base::RefCountedThreadSafe<Timeout> {
public:
- Timeout(DBusTimeout* timeout)
+ explicit Timeout(DBusTimeout* timeout)
: raw_timeout_(timeout),
monitoring_is_active_(false),
is_completed(false) {
@@ -181,7 +180,7 @@ Bus::Options::~Options() {
Bus::Bus(const Options& options)
: bus_type_(options.bus_type),
connection_type_(options.connection_type),
- dbus_thread_message_loop_proxy_(options.dbus_thread_message_loop_proxy),
+ dbus_task_runner_(options.dbus_task_runner),
on_shutdown_(false /* manual_reset */, false /* initially_signaled */),
connection_(NULL),
origin_thread_id_(base::PlatformThread::CurrentId()),
@@ -196,7 +195,7 @@ Bus::Bus(const Options& options)
// The origin message loop is unnecessary if the client uses synchronous
// functions only.
if (MessageLoop::current())
- origin_message_loop_proxy_ = MessageLoop::current()->message_loop_proxy();
+ origin_task_runner_ = MessageLoop::current()->message_loop_proxy();
}
Bus::~Bus() {
@@ -308,12 +307,12 @@ void Bus::UnregisterExportedObject(const ObjectPath& object_path) {
// Post the task to perform the final unregistration to the D-Bus thread.
// Since the registration also happens on the D-Bus thread in
- // TryRegisterObjectPath(), and the message loop proxy we post to is a
- // MessageLoopProxy which inherits from SequencedTaskRunner, there is a
- // guarantee that this will happen before any future registration call.
- PostTaskToDBusThread(FROM_HERE, base::Bind(
- &Bus::UnregisterExportedObjectInternal,
- this, exported_object));
+ // TryRegisterObjectPath(), and the task runner we post to is a
+ // SequencedTaskRunner, there is a guarantee that this will happen before any
+ // future registration call.
+ PostTaskToDBusThread(FROM_HERE,
+ base::Bind(&Bus::UnregisterExportedObjectInternal,
+ this, exported_object));
}
void Bus::UnregisterExportedObjectInternal(
@@ -438,7 +437,7 @@ void Bus::ShutdownAndBlock() {
void Bus::ShutdownOnDBusThreadAndBlock() {
AssertOnOriginThread();
- DCHECK(dbus_thread_message_loop_proxy_.get());
+ DCHECK(dbus_task_runner_.get());
PostTaskToDBusThread(FROM_HERE, base::Bind(
&Bus::ShutdownOnDBusThreadAndBlockInternal,
@@ -742,21 +741,21 @@ void Bus::ProcessAllIncomingDataIfAny() {
void Bus::PostTaskToOriginThread(const tracked_objects::Location& from_here,
const base::Closure& task) {
- DCHECK(origin_message_loop_proxy_.get());
- if (!origin_message_loop_proxy_->PostTask(from_here, task)) {
+ DCHECK(origin_task_runner_.get());
+ if (!origin_task_runner_->PostTask(from_here, task)) {
LOG(WARNING) << "Failed to post a task to the origin message loop";
}
}
void Bus::PostTaskToDBusThread(const tracked_objects::Location& from_here,
const base::Closure& task) {
- if (dbus_thread_message_loop_proxy_.get()) {
- if (!dbus_thread_message_loop_proxy_->PostTask(from_here, task)) {
+ if (dbus_task_runner_.get()) {
+ if (!dbus_task_runner_->PostTask(from_here, task)) {
LOG(WARNING) << "Failed to post a task to the D-Bus thread message loop";
}
} else {
- DCHECK(origin_message_loop_proxy_.get());
- if (!origin_message_loop_proxy_->PostTask(from_here, task)) {
+ DCHECK(origin_task_runner_.get());
+ if (!origin_task_runner_->PostTask(from_here, task)) {
LOG(WARNING) << "Failed to post a task to the origin message loop";
}
}
@@ -766,22 +765,21 @@ void Bus::PostDelayedTaskToDBusThread(
const tracked_objects::Location& from_here,
const base::Closure& task,
base::TimeDelta delay) {
- if (dbus_thread_message_loop_proxy_.get()) {
- if (!dbus_thread_message_loop_proxy_->PostDelayedTask(
+ if (dbus_task_runner_.get()) {
+ if (!dbus_task_runner_->PostDelayedTask(
from_here, task, delay)) {
LOG(WARNING) << "Failed to post a task to the D-Bus thread message loop";
}
} else {
- DCHECK(origin_message_loop_proxy_.get());
- if (!origin_message_loop_proxy_->PostDelayedTask(
- from_here, task, delay)) {
+ DCHECK(origin_task_runner_.get());
+ if (!origin_task_runner_->PostDelayedTask(from_here, task, delay)) {
LOG(WARNING) << "Failed to post a task to the origin message loop";
}
}
}
bool Bus::HasDBusThread() {
- return dbus_thread_message_loop_proxy_.get() != NULL;
+ return dbus_task_runner_.get() != NULL;
}
void Bus::AssertOnOriginThread() {
@@ -791,8 +789,8 @@ void Bus::AssertOnOriginThread() {
void Bus::AssertOnDBusThread() {
base::ThreadRestrictions::AssertIOAllowed();
- if (dbus_thread_message_loop_proxy_.get()) {
- DCHECK(dbus_thread_message_loop_proxy_->BelongsToCurrentThread());
+ if (dbus_task_runner_.get()) {
+ DCHECK(dbus_task_runner_->RunsTasksOnCurrentThread());
} else {
AssertOnOriginThread();
}
@@ -928,9 +926,9 @@ void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection,
}
DBusHandlerResult Bus::OnConnectionDisconnectedFilter(
- DBusConnection *connection,
- DBusMessage *message,
- void *data) {
+ DBusConnection* connection,
+ DBusMessage* message,
+ void* data) {
if (dbus_message_is_signal(message,
DBUS_INTERFACE_LOCAL,
kDisconnectedSignal)) {
diff --git a/dbus/bus.h b/dbus/bus.h
index 87df7c3..1641699 100644
--- a/dbus/bus.h
+++ b/dbus/bus.h
@@ -5,25 +5,28 @@
#ifndef DBUS_BUS_H_
#define DBUS_BUS_H_
+#include <dbus/dbus.h>
+
#include <map>
#include <set>
#include <string>
#include <utility>
-#include <dbus/dbus.h>
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread.h"
-#include "base/tracked_objects.h"
#include "dbus/dbus_export.h"
#include "dbus/object_path.h"
-class MessageLoop;
-
namespace base {
+class SequencedTaskRunner;
+class SingleThreadTaskRunner;
class Thread;
-class MessageLoopProxy;
+}
+
+namespace tracked_objects {
+class Location;
}
namespace dbus {
@@ -35,17 +38,17 @@ class ObjectProxy;
// proxies, and export objects.
//
// For asynchronous operations such as an asynchronous method call, the
-// bus object will use a message loop to monitor the underlying file
+// bus object will use a task runner to monitor the underlying file
// descriptor used for D-Bus communication. By default, the bus will use
-// the current thread's MessageLoopForIO. If |dbus_thread_message_loop_proxy|
-// option is specified, the bus will use that message loop instead.
+// the current thread's task runner. If |dbus_task_runner| option is
+// specified, the bus will use that task runner instead.
//
// THREADING
//
// In the D-Bus library, we use the two threads:
//
// - The origin thread: the thread that created the Bus object.
-// - The D-Bus thread: the thread servicing |dbus_thread_message_loop_proxy|.
+// - The D-Bus thread: the thread servicing |dbus_task_runner|.
//
// The origin thread is usually Chrome's UI thread. The D-Bus thread is
// usually a dedicated thread for the D-Bus library.
@@ -164,14 +167,14 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
BusType bus_type; // SESSION by default.
ConnectionType connection_type; // PRIVATE by default.
- // If dbus_thread_message_loop_proxy is set, the bus object will use that
- // message loop to process asynchronous operations.
+ // If dbus_task_runner is set, the bus object will use that
+ // task runner to process asynchronous operations.
//
- // The thread servicing the message loop proxy should meet the following
+ // The thread servicing the task runner should meet the following
// requirements:
// 1) Already running.
// 2) Has a MessageLoopForIO.
- scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy;
+ scoped_refptr<base::SequencedTaskRunner> dbus_task_runner;
// Specifies the server addresses to be connected. If you want to
// communicate with non dbus-daemon such as ibus-daemon, set |bus_type| to
@@ -463,20 +466,20 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// BLOCKING CALL.
virtual void UnregisterObjectPath(const ObjectPath& object_path);
- // Posts the task to the message loop of the thread that created the bus.
+ // Posts the task to the task runner of the thread that created the bus.
virtual void PostTaskToOriginThread(
const tracked_objects::Location& from_here,
const base::Closure& task);
- // Posts the task to the message loop of the D-Bus thread. If D-Bus
- // thread is not supplied, the message loop of the origin thread will be
+ // Posts the task to the task runner of the D-Bus thread. If D-Bus
+ // thread is not supplied, the task runner of the origin thread will be
// used.
virtual void PostTaskToDBusThread(
const tracked_objects::Location& from_here,
const base::Closure& task);
- // Posts the delayed task to the message loop of the D-Bus thread. If
- // D-Bus thread is not supplied, the message loop of the origin thread
+ // Posts the delayed task to the task runner of the D-Bus thread. If
+ // D-Bus thread is not supplied, the task runner of the origin thread
// will be used.
virtual void PostDelayedTaskToDBusThread(
const tracked_objects::Location& from_here,
@@ -566,17 +569,17 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// Calls OnConnectionDisconnected if the Diconnected signal is received.
static DBusHandlerResult OnConnectionDisconnectedFilter(
- DBusConnection *connection,
- DBusMessage *message,
- void *user_data);
+ DBusConnection* connection,
+ DBusMessage* message,
+ void* user_data);
const BusType bus_type_;
const ConnectionType connection_type_;
- scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_;
+ scoped_refptr<base::SequencedTaskRunner> dbus_task_runner_;
base::WaitableEvent on_shutdown_;
DBusConnection* connection_;
- scoped_refptr<base::MessageLoopProxy> origin_message_loop_proxy_;
+ scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner_;
base::PlatformThreadId origin_thread_id_;
std::set<std::string> owned_service_names_;
diff --git a/dbus/bus_unittest.cc b/dbus/bus_unittest.cc
index 6c002a8..a288d53 100644
--- a/dbus/bus_unittest.cc
+++ b/dbus/bus_unittest.cc
@@ -97,7 +97,7 @@ TEST(BusTest, RemoveObjectProxy) {
// Create the bus.
dbus::Bus::Options options;
- options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy();
+ options.dbus_task_runner = dbus_thread.message_loop_proxy();
scoped_refptr<dbus::Bus> bus = new dbus::Bus(options);
ASSERT_FALSE(bus->shutdown_completed());
@@ -177,7 +177,7 @@ TEST(BusTest, UnregisterExportedObject) {
// Create the bus.
dbus::Bus::Options options;
- options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy();
+ options.dbus_task_runner = dbus_thread.message_loop_proxy();
scoped_refptr<dbus::Bus> bus = new dbus::Bus(options);
ASSERT_FALSE(bus->shutdown_completed());
@@ -227,7 +227,7 @@ TEST(BusTest, ShutdownAndBlockWithDBusThread) {
// Create the bus.
dbus::Bus::Options options;
- options.dbus_thread_message_loop_proxy = dbus_thread.message_loop_proxy();
+ options.dbus_task_runner = dbus_thread.message_loop_proxy();
scoped_refptr<dbus::Bus> bus = new dbus::Bus(options);
ASSERT_FALSE(bus->shutdown_completed());
diff --git a/dbus/end_to_end_async_unittest.cc b/dbus/end_to_end_async_unittest.cc
index b91ea77..0a3446e 100644
--- a/dbus/end_to_end_async_unittest.cc
+++ b/dbus/end_to_end_async_unittest.cc
@@ -46,7 +46,7 @@ class EndToEndAsyncTest : public testing::Test {
// Start the test service, using the D-Bus thread.
dbus::TestService::Options options;
- options.dbus_thread_message_loop_proxy = dbus_thread_->message_loop_proxy();
+ options.dbus_task_runner = dbus_thread_->message_loop_proxy();
test_service_.reset(new dbus::TestService(options));
ASSERT_TRUE(test_service_->StartService());
ASSERT_TRUE(test_service_->WaitUntilServiceIsStarted());
@@ -56,8 +56,7 @@ class EndToEndAsyncTest : public testing::Test {
dbus::Bus::Options bus_options;
bus_options.bus_type = dbus::Bus::SESSION;
bus_options.connection_type = dbus::Bus::PRIVATE;
- bus_options.dbus_thread_message_loop_proxy =
- dbus_thread_->message_loop_proxy();
+ bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
bus_options.disconnected_callback =
base::Bind(&EndToEndAsyncTest::OnDisconnected, base::Unretained(this));
bus_ = new dbus::Bus(bus_options);
@@ -138,8 +137,7 @@ class EndToEndAsyncTest : public testing::Test {
bus_options.bus_type = dbus::Bus::CUSTOM_ADDRESS;
bus_options.address = kInvalidAddress;
bus_options.connection_type = dbus::Bus::PRIVATE;
- bus_options.dbus_thread_message_loop_proxy =
- dbus_thread_->message_loop_proxy();
+ bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
bus_ = new dbus::Bus(bus_options);
ASSERT_TRUE(bus_->HasDBusThread());
diff --git a/dbus/mock_bus.cc b/dbus/mock_bus.cc
index e97cd71..9e76454 100644
--- a/dbus/mock_bus.cc
+++ b/dbus/mock_bus.cc
@@ -4,9 +4,11 @@
#include "dbus/mock_bus.h"
+#include "base/location.h"
+
namespace dbus {
-MockBus::MockBus(Bus::Options& options) : Bus(options) {
+MockBus::MockBus(const Bus::Options& options) : Bus(options) {
}
MockBus::~MockBus() {
diff --git a/dbus/mock_bus.h b/dbus/mock_bus.h
index 33a62e0..9a87ecf7 100644
--- a/dbus/mock_bus.h
+++ b/dbus/mock_bus.h
@@ -16,7 +16,7 @@ namespace dbus {
// D-Bus calls.
class MockBus : public Bus {
public:
- MockBus(Bus::Options& options);
+ MockBus(const Bus::Options& options);
MOCK_METHOD2(GetObjectProxy, ObjectProxy*(const std::string& service_name,
const ObjectPath& object_path));
diff --git a/dbus/property_unittest.cc b/dbus/property_unittest.cc
index 052d98b..0172517 100644
--- a/dbus/property_unittest.cc
+++ b/dbus/property_unittest.cc
@@ -16,7 +16,6 @@
#include "dbus/bus.h"
#include "dbus/object_path.h"
#include "dbus/object_proxy.h"
-#include "dbus/property.h"
#include "dbus/test_service.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -57,7 +56,7 @@ class PropertyTest : public testing::Test {
// Start the test service, using the D-Bus thread.
dbus::TestService::Options options;
- options.dbus_thread_message_loop_proxy = dbus_thread_->message_loop_proxy();
+ options.dbus_task_runner = dbus_thread_->message_loop_proxy();
test_service_.reset(new dbus::TestService(options));
ASSERT_TRUE(test_service_->StartService());
ASSERT_TRUE(test_service_->WaitUntilServiceIsStarted());
@@ -67,8 +66,7 @@ class PropertyTest : public testing::Test {
dbus::Bus::Options bus_options;
bus_options.bus_type = dbus::Bus::SESSION;
bus_options.connection_type = dbus::Bus::PRIVATE;
- bus_options.dbus_thread_message_loop_proxy =
- dbus_thread_->message_loop_proxy();
+ bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
bus_ = new dbus::Bus(bus_options);
object_proxy_ = bus_->GetObjectProxy(
"org.chromium.TestService",
diff --git a/dbus/signal_sender_verification_unittest.cc b/dbus/signal_sender_verification_unittest.cc
index d2be464..d66067f 100644
--- a/dbus/signal_sender_verification_unittest.cc
+++ b/dbus/signal_sender_verification_unittest.cc
@@ -41,8 +41,7 @@ class SignalSenderVerificationTest : public testing::Test {
dbus::Bus::Options bus_options;
bus_options.bus_type = dbus::Bus::SESSION;
bus_options.connection_type = dbus::Bus::PRIVATE;
- bus_options.dbus_thread_message_loop_proxy =
- dbus_thread_->message_loop_proxy();
+ bus_options.dbus_task_runner = dbus_thread_->message_loop_proxy();
bus_ = new dbus::Bus(bus_options);
object_proxy_ = bus_->GetObjectProxy(
"org.chromium.TestService",
@@ -68,7 +67,7 @@ class SignalSenderVerificationTest : public testing::Test {
// Start the test service, using the D-Bus thread.
dbus::TestService::Options options;
- options.dbus_thread_message_loop_proxy = dbus_thread_->message_loop_proxy();
+ options.dbus_task_runner = dbus_thread_->message_loop_proxy();
test_service_.reset(new dbus::TestService(options));
ASSERT_TRUE(test_service_->StartService());
ASSERT_TRUE(test_service_->WaitUntilServiceIsStarted());
@@ -87,7 +86,6 @@ class SignalSenderVerificationTest : public testing::Test {
if (!on_name_owner_changed_called_)
message_loop_.Run();
ASSERT_FALSE(latest_name_owner_.empty());
-
}
virtual void TearDown() {
@@ -148,7 +146,6 @@ class SignalSenderVerificationTest : public testing::Test {
}
protected:
-
// Wait for the hey signal to be received.
void WaitForTestSignal() {
// OnTestSignal() will quit the message loop.
diff --git a/dbus/test_server.cc b/dbus/test_server.cc
index 827f62d..0c5cc756 100644
--- a/dbus/test_server.cc
+++ b/dbus/test_server.cc
@@ -19,7 +19,7 @@ int main(int argc, char** argv) {
CHECK(dbus_thread->StartWithOptions(thread_options));
dbus::TestService::Options options;
- options.dbus_thread_message_loop_proxy = dbus_thread->message_loop_proxy();
+ options.dbus_task_runner = dbus_thread->message_loop_proxy();
dbus::TestService* test_service = new dbus::TestService(options);
CHECK(test_service->StartService());
CHECK(test_service->WaitUntilServiceIsStarted());
diff --git a/dbus/test_service.cc b/dbus/test_service.cc
index d9dbf82..fcc34121 100644
--- a/dbus/test_service.cc
+++ b/dbus/test_service.cc
@@ -33,7 +33,7 @@ TestService::Options::~Options() {
TestService::TestService(const Options& options)
: base::Thread("TestService"),
- dbus_thread_message_loop_proxy_(options.dbus_thread_message_loop_proxy),
+ dbus_task_runner_(options.dbus_task_runner),
on_all_methods_exported_(false, false),
num_exported_methods_(0) {
}
@@ -155,7 +155,7 @@ void TestService::Run(MessageLoop* message_loop) {
Bus::Options bus_options;
bus_options.bus_type = Bus::SESSION;
bus_options.connection_type = Bus::PRIVATE;
- bus_options.dbus_thread_message_loop_proxy = dbus_thread_message_loop_proxy_;
+ bus_options.dbus_task_runner = dbus_task_runner_;
bus_ = new Bus(bus_options);
bus_->RequestOwnership("org.chromium.TestService",
diff --git a/dbus/test_service.h b/dbus/test_service.h
index 30f8216..562e7c4 100644
--- a/dbus/test_service.h
+++ b/dbus/test_service.h
@@ -12,7 +12,7 @@
#include "dbus/exported_object.h"
namespace base {
-class MessageLoopProxy;
+class SequencedTaskRunner;
}
namespace dbus {
@@ -35,13 +35,13 @@ class TestService : public base::Thread {
~Options();
// NULL by default (i.e. don't use the D-Bus thread).
- scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy;
+ scoped_refptr<base::SequencedTaskRunner> dbus_task_runner;
};
// The number of methods we'll export.
static const int kNumMethodsToExport;
- TestService(const Options& options);
+ explicit TestService(const Options& options);
virtual ~TestService();
// Starts the service in a separate thread.
@@ -143,7 +143,7 @@ class TestService : public base::Thread {
// Helper function for RequestOwnership().
void RequestOwnershipInternal(base::Callback<void(bool)> callback);
- scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_;
+ scoped_refptr<base::SequencedTaskRunner> dbus_task_runner_;
base::WaitableEvent on_all_methods_exported_;
// The number of methods actually exported.
int num_exported_methods_;
diff --git a/device/media_transfer_protocol/media_transfer_protocol_manager.cc b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
index ba345d2..bbd13b3 100644
--- a/device/media_transfer_protocol/media_transfer_protocol_manager.cc
+++ b/device/media_transfer_protocol/media_transfer_protocol_manager.cc
@@ -51,7 +51,7 @@ class MediaTransferProtocolManagerImpl : public MediaTransferProtocolManager {
dbus::Bus::Options options;
options.bus_type = dbus::Bus::SYSTEM;
options.connection_type = dbus::Bus::PRIVATE;
- options.dbus_thread_message_loop_proxy = loop_proxy;
+ options.dbus_task_runner = loop_proxy;
session_bus_ = new dbus::Bus(options);
bus = session_bus_.get();
#endif