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

Unified Diff: src/device.h

Issue 5380002: cashew: defer all D-Bus signal processing to main loop (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/cashew.git@master
Patch Set: Created 10 years, 1 month 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
Index: src/device.h
diff --git a/src/device.h b/src/device.h
index e9c470accb8102501432f5d068dfaaaec150a913..dae74f6c7e9f785f6424d1189dbcfea8817684fc 100644
--- a/src/device.h
+++ b/src/device.h
@@ -14,6 +14,7 @@
#include "src/byte_counter.h"
#include "src/flimflam_device_client_glue.h"
+#include "src/property_changed_handler.h"
namespace cashew {
@@ -24,7 +25,8 @@ class Service;
class Device : public org::chromium::flimflam::Device_proxy,
public DBus::IntrospectableProxy,
public DBus::ObjectProxy,
- public ByteCounterDelegate {
+ public ByteCounterDelegate,
+ public PropertyChangedDelegate {
public:
Device(Service * const parent, DBus::Connection& connection, // NOLINT
const DBus::Path& path);
@@ -59,9 +61,17 @@ class Device : public org::chromium::flimflam::Device_proxy,
// Flimflam Device D-Bus Proxy methods
+ // receive incoming PropertyChanged D-Bus signal from Flimflam device and
+ // schedule deferred processing
virtual void PropertyChanged(const std::string& property_name,
const DBus::Variant& new_value);
+ // PropertyChangedDelegate methods
+
+ virtual void OnPropertyChanged(const PropertyChangedHandler *handler,
+ const std::string& property_name,
+ const DBus::Variant& new_value);
+
// Service methods
// start a new byte counter from 0
@@ -133,6 +143,10 @@ class Device : public org::chromium::flimflam::Device_proxy,
// name and therefore may not yet have created a byte counter object.
bool byte_counter_running_;
+ // Handler for deferred processing of D-Bus PropertyChanged signals.
+ // See comments in service_manager.h
+ PropertyChangedHandler property_changed_handler_;
+
// convert type string to Type enum value
Type TypeFromString(const std::string& type) const;
« no previous file with comments | « src/cashew_server.cc ('k') | src/device.cc » ('j') | src/property_changed_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698