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

Unified Diff: chromeos/dbus/shill_client_helper.h

Issue 12220128: Shill: Delay the ConnectToSignal call until an observer is added. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 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/shill_client_helper.cc » ('j') | chromeos/dbus/shill_client_helper.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d292065b75c7ca3b1692d0d43c359f01fec3e5c5 100644
--- a/chromeos/dbus/shill_client_helper.h
+++ b/chromeos/dbus/shill_client_helper.h
@@ -72,7 +72,9 @@ class ShillClientHelper {
// 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 +127,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 +185,7 @@ class ShillClientHelper {
PropertyChangedHandler property_changed_handler_;
ObserverList<ShillPropertyChangedObserver, true /* check_empty */>
observer_list_;
+ std::vector<std::string> monitored_interfaces_;
hashimoto 2013/02/13 04:01:31 nit: Since all users are using this class for a si
deymo 2013/02/13 05:41:07 1st nit: The current interface doesn't prevent som
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
« no previous file with comments | « no previous file | chromeos/dbus/shill_client_helper.cc » ('j') | chromeos/dbus/shill_client_helper.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698