Chromium Code Reviews| Index: dbus/test_service.cc |
| diff --git a/dbus/test_service.cc b/dbus/test_service.cc |
| index ee1befb630a3766c21cd86fa8d2de3f7873590ac..87c6e01ba704d590b9c2ec558d8e06ed78027250 100644 |
| --- a/dbus/test_service.cc |
| +++ b/dbus/test_service.cc |
| @@ -103,6 +103,19 @@ void TestService::SendTestSignalFromRootInternal(const std::string& message) { |
| root_object->SendSignal(&signal); |
| } |
| +void TestService::RequestOwnership() { |
| + message_loop()->PostTask( |
|
satorux1
2012/10/26 05:26:00
Why do you need to post this to the message loop o
Haruki Sato
2012/10/26 05:53:13
Hmm,
Calling bus->RequestOwnership() here causes
|
| + FROM_HERE, |
| + base::Bind(&TestService::RequestOwnershipInternal, |
| + base::Unretained(this))); |
| +} |
| + |
| +void TestService::RequestOwnershipInternal() { |
| + bus_->RequestOwnership("org.chromium.TestService", |
| + base::Bind(&TestService::OnOwnership, |
| + base::Unretained(this))); |
| +} |
| + |
| void TestService::OnOwnership(const std::string& service_name, |
| bool success) { |
| LOG_IF(ERROR, !success) << "Failed to own: " << service_name; |