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

Unified Diff: dbus/test_service.cc

Issue 11199007: Add sender verification of D-Bus signals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: use the default Created 8 years, 2 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 | « dbus/test_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
+ 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;
« no previous file with comments | « dbus/test_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698