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

Unified Diff: device/battery/battery_monitor_impl.cc

Issue 728553002: Update mojo sdk to rev afb4440fd5a10cba980878c326180b7ad7960480 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « device/battery/battery_monitor_impl.h ('k') | media/mojo/services/mojo_demuxer_stream_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/battery/battery_monitor_impl.cc
diff --git a/device/battery/battery_monitor_impl.cc b/device/battery/battery_monitor_impl.cc
index 3cbf57d39394caa1e227fb677c4679a32bb24912..dc07b62df1a8a2485016c3a059ee0be294c76c51 100644
--- a/device/battery/battery_monitor_impl.cc
+++ b/device/battery/battery_monitor_impl.cc
@@ -11,24 +11,26 @@ namespace device {
// static
void BatteryMonitorImpl::Create(
mojo::InterfaceRequest<BatteryMonitor> request) {
- BindToRequest(new BatteryMonitorImpl(), &request);
+ new BatteryMonitorImpl(request.Pass());
}
-BatteryMonitorImpl::BatteryMonitorImpl() {
+BatteryMonitorImpl::BatteryMonitorImpl(
+ mojo::InterfaceRequest<BatteryMonitor> request)
+ : binding_(this, request.Pass()),
+ subscription_(BatteryStatusService::GetInstance()->AddCallback(
+ base::Bind(&BatteryMonitorImpl::DidChange, base::Unretained(this)))) {
}
BatteryMonitorImpl::~BatteryMonitorImpl() {
}
-void BatteryMonitorImpl::OnConnectionEstablished() {
- subscription_ = BatteryStatusService::GetInstance()->AddCallback(
- base::Bind(&BatteryMonitorImpl::DidChange, base::Unretained(this)));
+void BatteryMonitorImpl::RegisterSubscription() {
}
void BatteryMonitorImpl::DidChange(const BatteryStatus& battery_status) {
BatteryStatusPtr status(BatteryStatus::New());
*status = battery_status;
- client()->DidChange(status.Pass());
+ binding_.client()->DidChange(status.Pass());
}
} // namespace device
« no previous file with comments | « device/battery/battery_monitor_impl.h ('k') | media/mojo/services/mojo_demuxer_stream_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698