Index: chromeos/dbus/shill_client_helper.h |
diff --git a/chromeos/dbus/shill_client_helper.h b/chromeos/dbus/shill_client_helper.h |
index b8f769c4fcf76dc0aaeb848b6584b78c7c875d72..52631a9028a4fb03e19dc874d2ee5693f2cceeb5 100644 |
--- a/chromeos/dbus/shill_client_helper.h |
+++ b/chromeos/dbus/shill_client_helper.h |
@@ -66,13 +66,23 @@ class ShillClientHelper { |
virtual ~ShillClientHelper(); |
+ // Returns true if there is a PropertyChangedObserver registered. |
+ bool IsObserved() const; |
+ |
+ // Returns true if the are method calls waiting for a response. If this |
+ // function is called from within the return callback return true only if |
+ // there are *other* calls waiting for a response. |
+ bool IsWaitingResponse() const; |
+ |
// Adds an |observer| of the PropertyChanged signal. |
void AddPropertyChangedObserver(ShillPropertyChangedObserver* observer); |
// Removes an |observer| of the PropertyChanged signal. |
void RemovePropertyChangedObserver(ShillPropertyChangedObserver* observer); |
- // Starts monitoring PropertyChanged signal. |
+ // Starts monitoring PropertyChanged signal. If there aren't observers for the |
+ // PropertyChanged signal, the actual monitoring will be delayed until the |
+ // first observer is added. |
void MonitorPropertyChanged(const std::string& interface_name); |
// Calls a method without results. |
@@ -125,6 +135,9 @@ class ShillClientHelper { |
const base::Value& value); |
private: |
+ // Starts monitoring PropertyChanged signal. |
+ void MonitorPropertyChangedInternal(const std::string& interface_name); |
+ |
// Handles the result of signal connection setup. |
void OnSignalConnected(const std::string& interface, |
const std::string& signal, |
@@ -180,6 +193,8 @@ class ShillClientHelper { |
PropertyChangedHandler property_changed_handler_; |
ObserverList<ShillPropertyChangedObserver, true /* check_empty */> |
observer_list_; |
+ int in_progress_calls_; |
+ std::vector<std::string> monitored_interfaces_; |
// Note: This should remain the last member so it'll be destroyed and |
// invalidate its weak pointers before any other members are destroyed. |