shill: Provide notification callbacks on DHCP configuration updates.
BUG=chromium-os:16257
TEST=unit tests
Change-Id: Ifef3eb4e295bea21a05bce4af440536472953a8b
Reviewed-on: http://gerrit.chromium.org/gerrit/2273
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
diff --git a/ipconfig.cc b/ipconfig.cc
index b386c46..12c20f0 100644
--- a/ipconfig.cc
+++ b/ipconfig.cc
@@ -34,7 +34,14 @@
void IPConfig::UpdateProperties(const Properties &properties) {
properties_ = properties;
- // TODO(petkov): Notify listeners about the new properties.
+ if (update_callback_.get()) {
+ update_callback_->Run(this);
+ }
+}
+
+void IPConfig::RegisterUpdateCallback(
+ Callback1<IPConfigRefPtr>::Type *callback) {
+ update_callback_.reset(callback);
}
} // namespace shill