summaryrefslogtreecommitdiffstats
path: root/dbus/test_service.h
diff options
context:
space:
mode:
authorharuki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-29 06:27:33 +0000
committerharuki@chromium.org <haruki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-29 06:27:33 +0000
commit8bbe31e8cea633027e3b2ba151774aebf8a4d4ee (patch)
tree90752daeede7ee2da4439818d5ac75ae34fab5c8 /dbus/test_service.h
parent981f063b1d30a8a963f6e5f734496e4754c340e6 (diff)
downloadchromium_src-8bbe31e8cea633027e3b2ba151774aebf8a4d4ee.zip
chromium_src-8bbe31e8cea633027e3b2ba151774aebf8a4d4ee.tar.gz
chromium_src-8bbe31e8cea633027e3b2ba151774aebf8a4d4ee.tar.bz2
Add sender verification of D-Bus signals.
The CL does the following: - Add a match rule for NameOwnerChanged signal from org.freedesktop.DBus. - Update the owner of the well-known bus name when a NameOwnerChanged comes. - Call GetNameOwner method to update the latest if ObjectProxy instance does not know the owner. - Verify the sender of the signal and reject the unknown senders. - Add UMA_HISTOGRAM_COUNTS "DBus.RejectedSignalCount" for rejected signals. and a unittest. BUG=140938 TEST=manual, unittests Review URL: https://chromiumcodereview.appspot.com/11199007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/test_service.h')
-rw-r--r--dbus/test_service.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/dbus/test_service.h b/dbus/test_service.h
index 871aed6..17f27ca 100644
--- a/dbus/test_service.h
+++ b/dbus/test_service.h
@@ -65,6 +65,9 @@ class TestService : public base::Thread {
// This function emulates dbus-send's behavior.
void SendTestSignalFromRoot(const std::string& message);
+ // Request the ownership of a well-known name "TestService".
+ void RequestOwnership();
+
private:
// Helper function for SendTestSignal().
void SendTestSignalInternal(const std::string& message);
@@ -127,6 +130,9 @@ class TestService : public base::Thread {
// Helper function for SendPropertyChangedSignal().
void SendPropertyChangedSignalInternal(const std::string& name);
+ // Helper function for RequestOwnership().
+ void RequestOwnershipInternal();
+
scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_;
base::WaitableEvent on_all_methods_exported_;
// The number of methods actually exported.