DescriptionStop using [Client=...] feature of Mojom for GeolocationService
Change GeolocationService to instead have a QueryNextPosition() method that clients can use to poll for changes to location. The first call will complete immediately, reporting the current location. After that, QueryNextPosition() will "hang" until there is a change to report.
This also solves a defect (anti-pattern) with the older design, which could result in the service consuming a lot of memory. That could happen if the client failed to consume any of the OnLocationUpdate messages. Eventually, the pipe would back up, and queuing of MojoWriteMessage calls would occur in the service's process. By switching to a polling design, this problem is eliminated.
See further description of the anti-pattern here: https://groups.google.com/a/chromium.org/forum/#!topic/mojo-dev/pSNDDN3gpFo
Committed: https://crrev.com/317e773e3499fe6a19871b5498a5c6164d972316
Cr-Commit-Position: refs/heads/master@{#311217}
Patch Set 1 #
Total comments: 4
Patch Set 2 : revisions per review feedback #Patch Set 3 : improve comments #
Messages
Total messages: 12 (2 generated)
|