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

Unified Diff: src/service.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/service.h
diff --git a/src/service.h b/src/service.h
index 5143fedc82df265006a4c0da6e80769160db5d93..2382b738766259acff33a506d1ea17b3e669f851 100644
--- a/src/service.h
+++ b/src/service.h
@@ -18,6 +18,7 @@
#include "src/data_plan.h"
#include "src/data_plan_provider.h"
#include "src/flimflam_service_client_glue.h"
+#include "src/property_changed_handler.h"
namespace cashew {
@@ -32,7 +33,8 @@ typedef std::map<std::string, DBus::Variant> PropertyMap;
class Service : public org::chromium::flimflam::Service_proxy,
public DBus::IntrospectableProxy,
public DBus::ObjectProxy,
- public DataPlanProviderDelegate {
+ public DataPlanProviderDelegate,
+ public PropertyChangedDelegate {
public:
Service(ServiceManager * const parent,
DBus::Connection& connection, // NOLINT
@@ -98,10 +100,17 @@ class Service : public org::chromium::flimflam::Service_proxy,
// Flimflam Service D-Bus Proxy methods
- // receive incoming PropertyChanged D-Bus signal from Flimflam service
+ // receive incoming PropertyChanged D-Bus signal from Flimflam service 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);
+
// Device methods
// we've received updated Cellular.Carrier info from our child Device
@@ -199,6 +208,10 @@ class Service : public org::chromium::flimflam::Service_proxy,
// finer-grained connectivity info applicable when |state_| == kStateReady
ConnectivityState connectivity_state_;
+ // Handler for deferred processing of D-Bus PropertyChanged signals.
+ // See comments in service_manager.h
+ PropertyChangedHandler property_changed_handler_;
+
// convert connectivity state string to ConnectivityState enum value
static ConnectivityState ConnectivityStateFromString(
const std::string& connectivity_state);

Powered by Google App Engine
This is Rietveld 408576698