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 { | |
| 16 // These values follow the W3C geolocation specification and can be returned | |
| 17 // to JavaScript without the need for a conversion. | |
| 18 // https://dev.w3.org/geo/api/spec-source.html - 5.5 PositionError interface | |
| 19 enum ErrorCode { | |
| 20 option allow_alias = true; | |
| 21 ERROR_CODE_NONE = 0; | |
| 22 ERROR_CODE_PERMISSION_DENIED = 1; | |
| 23 ERROR_CODE_POSITION_UNAVAILABLE = 2; | |
| 24 ERROR_CODE_TIMEOUT = 3; | |
| 25 ERROR_CODE_LAST = 3; | |
|
Kevin M
2016/06/29 17:52:55
No need to define this - the pb compiler defines a
CJ
2016/07/11 23:21:06
Removed them. Can you explain more about the valid
| |
| 26 } | |
| 27 | |
| 28 optional ErrorCode error_code = 1; | |
| 29 optional string error_message = 2; | |
| 30 } | |
| 31 | |
| 32 message LocationMessage { | |
| 33 // Refer to content/public/common/geoposition.h for explanation of | |
| 34 // these fields and associated units. | |
| 35 optional double latitude = 1; | |
| 36 optional double longitude = 2; | |
| 37 optional double altitude = 3; | |
| 38 optional double accuracy = 4; | |
| 39 optional double altitude_accuracy = 5; | |
| 40 optional double heading = 6; | |
| 41 optional double speed = 7; | |
| 42 optional int64 timestamp_millis = 8; | |
| 43 } | |
| 44 | |
| 45 message UpdateListenStateMessage { | |
| 46 // These values represent the various listening states the server can have. | |
| 47 // A ListenState containing an accuracy level indicates that the server is | |
| 48 // waiting for either high or low accuracy position updates from the client. | |
| 49 // If a STOPPED listen state is sent, the server is no longer listening for | |
| 50 // updates. | |
| 51 enum ListenState { | |
| 52 ACCURACY_HIGH = 0; | |
| 53 ACCURACY_LOW = 1; | |
| 54 STOPPED = 2; | |
| 55 } | |
| 56 | |
| 57 optional ListenState listen_state = 1; | |
| 58 } | |
| 59 | |
| 60 message GeolocationMessage { | |
| 61 oneof type { | |
| 62 // Server => Client types. | |
| 63 UpdateListenStateMessage update_listen_state = 1; | |
| 64 EmptyMessage request_refresh = 2; | |
| 65 | |
| 66 // Client => Server types. | |
| 67 LocationMessage location = 3; | |
| 68 ErrorMessage error = 4; | |
| 69 } | |
| 70 } | |
| OLD | NEW |