Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 5 // Message definitions for geolocation messages. | |
| 6 | |
| 7 syntax = "proto2"; | |
| 8 | |
| 9 option optimize_for = LITE_RUNTIME; | |
| 10 | |
| 11 import "common.proto"; | |
| 12 | |
| 13 package blimp; | |
| 14 | |
| 15 message ErrorMessage { | |
|
Wez
2016/07/12 21:35:12
Remember that message names are scoped to the pack
CJ
2016/07/13 21:49:19
Done.
| |
| 16 // These values follow the W3C geolocation specification and can be returned | |
| 17 // to JavaScript without the need for a conversion. | |
|
Wez
2016/07/12 21:35:12
The Blink interface for PositionError (see https:/
CJ
2016/07/13 21:49:19
Removed comment.
| |
| 18 // https://dev.w3.org/geo/api/spec-source.html - 5.5 PositionError interface | |
| 19 enum ErrorCode { | |
| 20 ERROR_CODE_NONE = 0; | |
|
Wez
2016/07/12 21:35:12
Do we need NONE as an error enum value? Surely by
CJ
2016/07/13 21:49:19
Sure. Good point. Since I'm making a different mes
| |
| 21 ERROR_CODE_PERMISSION_DENIED = 1; | |
| 22 ERROR_CODE_POSITION_UNAVAILABLE = 2; | |
| 23 ERROR_CODE_TIMEOUT = 3; | |
| 24 } | |
| 25 | |
| 26 optional ErrorCode error_code = 1; | |
| 27 optional string error_message = 2; | |
| 28 } | |
| 29 | |
| 30 message LocationMessage { | |
|
Wez
2016/07/12 21:35:12
nit: We should use either Location or Geolocation
CJ
2016/07/13 21:49:19
Done.
| |
| 31 // Refer to content/public/common/geoposition.h for explanation of | |
|
Wez
2016/07/12 21:35:12
geoposition.h is part of the Chromium-specific Con
CJ
2016/07/13 21:49:19
Added GeolocationCoordinates.
As for the comment
| |
| 32 // these fields and associated units. | |
| 33 optional double latitude = 1; | |
| 34 optional double longitude = 2; | |
| 35 optional double altitude = 3; | |
| 36 optional double accuracy = 4; | |
| 37 optional double altitude_accuracy = 5; | |
| 38 optional double heading = 6; | |
| 39 optional double speed = 7; | |
| 40 optional int64 timestamp_millis = 8; | |
| 41 } | |
| 42 | |
| 43 message UpdateListenStateMessage { | |
|
Wez
2016/07/12 21:35:12
nit: Suggest GeolocationRequestMessage, Geolocatio
CJ
2016/07/13 21:49:19
Done.
| |
| 44 // These values represent the various listening states the server can have. | |
| 45 // A ListenState containing an accuracy level indicates that the server is | |
| 46 // waiting for either high or low accuracy position updates from the client. | |
| 47 // If a STOPPED listen state is sent, the server is no longer listening for | |
| 48 // updates. | |
| 49 enum ListenState { | |
| 50 STOPPED = 0; | |
| 51 ACCURACY_HIGH = 1; | |
| 52 ACCURACY_LOW = 2; | |
| 53 } | |
| 54 | |
| 55 optional ListenState listen_state = 1; | |
| 56 } | |
| 57 | |
| 58 message GeolocationMessage { | |
| 59 oneof type { | |
| 60 // Server => Client types. | |
| 61 UpdateListenStateMessage update_listen_state = 1; | |
| 62 EmptyMessage request_refresh = 2; | |
| 63 | |
| 64 // Client => Server types. | |
| 65 LocationMessage location = 3; | |
| 66 ErrorMessage error = 4; | |
| 67 } | |
| 68 } | |
| OLD | NEW |