Merge lp:~thomas-voss/location-service/make-client-resilient-against-service-going-away into lp:location-service

Proposed by Thomas Voß
Status: Merged
Approved by: Thomas Voß
Approved revision: 295
Merged at revision: 295
Proposed branch: lp:~thomas-voss/location-service/make-client-resilient-against-service-going-away
Merge into: lp:location-service
Diff against target: 72 lines (+27/-18)
1 file modified
src/location/dbus/stub/session.cpp (+27/-18)
To merge this branch: bzr merge lp:~thomas-voss/location-service/make-client-resilient-against-service-going-away
Reviewer Review Type Date Requested Status
Simon Fels (community) Approve
Thomas Voß Pending
Review via email: mp+319641@code.launchpad.net

Commit message

Make stub::Session resilient against the service going away.

Description of the change

Make stub::Session resilient against the service going away.

To post a comment you must log in.
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/location/dbus/stub/session.cpp'
--- src/location/dbus/stub/session.cpp 2017-03-04 21:43:23 +0000
+++ src/location/dbus/stub/session.cpp 2017-03-11 21:15:41 +0000
@@ -191,13 +191,16 @@
191 {191 {
192 if (auto thiz = holder->value.lock())192 if (auto thiz = holder->value.lock())
193 {193 {
194 auto update =194 if (auto variant = com_ubuntu_location_service_session_get_position(thiz->session_.get()))
195 location::dbus::decode<195 {
196 location::Update<location::Position>196 auto update =
197 >(com_ubuntu_location_service_session_get_position(thiz->session_.get()));197 location::dbus::decode<
198 location::Update<location::Position>
199 >(variant);
198200
199 if (update)201 if (update)
200 thiz->updates().position = *update;202 thiz->updates().position = *update;
203 }
201 }204 }
202 }205 }
203}206}
@@ -212,13 +215,16 @@
212 {215 {
213 if (auto thiz = holder->value.lock())216 if (auto thiz = holder->value.lock())
214 {217 {
215 auto update =218 if (auto variant = com_ubuntu_location_service_session_get_heading(thiz->session_.get()))
216 location::dbus::decode<219 {
217 location::Update<units::Degrees>220 auto update =
218 >(com_ubuntu_location_service_session_get_heading(thiz->session_.get()));221 location::dbus::decode<
222 location::Update<units::Degrees>
223 >(variant);
219224
220 if (update)225 if (update)
221 thiz->updates().heading = *update;226 thiz->updates().heading = *update;
227 }
222 }228 }
223 }229 }
224}230}
@@ -233,13 +239,16 @@
233 {239 {
234 if (auto thiz = holder->value.lock())240 if (auto thiz = holder->value.lock())
235 {241 {
236 auto update =242 if (auto variant = com_ubuntu_location_service_session_get_velocity(thiz->session_.get()))
237 location::dbus::decode<243 {
238 location::Update<units::MetersPerSecond>244 auto update =
239 >(com_ubuntu_location_service_session_get_velocity(thiz->session_.get()));245 location::dbus::decode<
246 location::Update<units::MetersPerSecond>
247 >(variant);
240248
241 if (update)249 if (update)
242 thiz->updates().velocity = *update;250 thiz->updates().velocity = *update;
251 }
243 }252 }
244 }253 }
245}254}

Subscribers

People subscribed via source and target branches

to all changes: