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

Unified Diff: chromeos/dbus/dbus.h

Issue 6485006: MonitorSignal low-level wrapper introduced (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/common.git@master
Patch Set: forgotten comments Created 9 years, 10 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 | « no previous file | chromeos/dbus/dbus.cc » ('j') | chromeos/dbus/dbus.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/dbus.h
diff --git a/chromeos/dbus/dbus.h b/chromeos/dbus/dbus.h
index 025802160d4f4155ef60a9ea3522171b7fbd7a7b..ac1ae06e28de6d502e91a4fd9d4d1652c8c2501f 100644
--- a/chromeos/dbus/dbus.h
+++ b/chromeos/dbus/dbus.h
@@ -5,6 +5,7 @@
#ifndef CHROMEOS_DBUS_H_
#define CHROMEOS_DBUS_H_
+#include <dbus/dbus-glib-lowlevel.h>
Daniel Erat 2011/02/10 23:07:24 do you need this in the header, or can you forward
glotov 2011/02/11 16:36:52 Done.
#include <dbus/dbus-glib.h>
#include <glib-object.h>
@@ -416,6 +417,29 @@ void SendSignalWithNoArgumentsToSystemBus(const char* path,
const char* interface_name,
const char* signal_name);
+// \brief Low-level signal monitor base class.
+//
+// Used when there is no definite named signal sender (that Proxy
+// could be used for).
+
+class MonitorSignal {
Daniel Erat 2011/02/10 23:13:36 ah, just looked at the change where you're using i
glotov 2011/02/11 16:36:52 Done.
+ public:
+ MonitorSignal() : interface_(NULL), signal_(NULL) {}
+ ~MonitorSignal();
+ void StartMonitoring(const char* interface, const char* signal);
Daniel Erat 2011/02/10 23:07:24 it might be a bit cleaner to pass |interface| and
glotov 2011/02/11 16:36:52 Start monitoring in ctor is not good because deriv
+ private:
+ // Callback invoked on the given signal arrival.
+ virtual void OnSignal(DBusMessage* message) = 0;
Daniel Erat 2011/02/10 23:07:24 nit: add a blank line between each method signatur
glotov 2011/02/11 16:36:52 Done.
+ // Returns a string matching the D-Bus messages that we want to listen for.
+ std::string GetDBusMatchString() const;
+ // A D-Bus message filter to receive signals.
+ static DBusHandlerResult FilterDBusMessage(DBusConnection* dbus_conn,
+ DBusMessage* message,
+ void* data);
+ const char* interface_;
+ const char* signal_;
+};
+
} // namespace dbus
} // namespace chromeos
« no previous file with comments | « no previous file | chromeos/dbus/dbus.cc » ('j') | chromeos/dbus/dbus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698