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

Unified Diff: device/battery/battery_monitor_impl.cc

Issue 728043002: Revert of 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 dc07b62df1a8a2485016c3a059ee0be294c76c51..3cbf57d39394caa1e227fb677c4679a32bb24912 100644
--- a/device/battery/battery_monitor_impl.cc
+++ b/device/battery/battery_monitor_impl.cc
@@ -11,26 +11,24 @@
// static
void BatteryMonitorImpl::Create(
mojo::InterfaceRequest<BatteryMonitor> request) {
- new BatteryMonitorImpl(request.Pass());
+ BindToRequest(new BatteryMonitorImpl(), &request);
}
-BatteryMonitorImpl::BatteryMonitorImpl(
- mojo::InterfaceRequest<BatteryMonitor> request)
- : binding_(this, request.Pass()),
- subscription_(BatteryStatusService::GetInstance()->AddCallback(
- base::Bind(&BatteryMonitorImpl::DidChange, base::Unretained(this)))) {
+BatteryMonitorImpl::BatteryMonitorImpl() {
}
BatteryMonitorImpl::~BatteryMonitorImpl() {
}
-void BatteryMonitorImpl::RegisterSubscription() {
+void BatteryMonitorImpl::OnConnectionEstablished() {
+ subscription_ = BatteryStatusService::GetInstance()->AddCallback(
+ base::Bind(&BatteryMonitorImpl::DidChange, base::Unretained(this)));
}
void BatteryMonitorImpl::DidChange(const BatteryStatus& battery_status) {
BatteryStatusPtr status(BatteryStatus::New());
*status = battery_status;
- binding_.client()->DidChange(status.Pass());
+ 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