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 module device.sensors; | |
|
Ken Rockot(use gerrit already)
2016/06/28 16:18:29
No nested namespaces please (we have to fix some e
shalamov
2016/06/29 15:02:17
Done.
| |
| 6 | |
| 7 import "sensor.mojom"; | |
| 8 | |
| 9 // Interface that allows its clients to create instances of Sensor inerface. | |
| 10 // | |
| 11 // @param type - SensorType, type of the sensor that should be created. | |
|
Ken Rockot(use gerrit already)
2016/06/28 16:18:29
This argument documentation syntax seems arbitrary
shalamov
2016/06/29 15:02:17
Done.
| |
| 12 // @param sensor_request - Sensor interface that is initialized by the factory. | |
| 13 // @return result - Result of the request, SUCCESS on success, FAILURE otherwise . | |
| 14 // @return shmem - SharedBuffer handle that is used by the client to fetch | |
| 15 // sensor reading, or null if the request has failed. | |
| 16 // @return offset - The offset at which SharedBuffer must be mapped by client. | |
| 17 // @return size - The size of a sensor reading. | |
| 18 // @return mode - The ReportingMode that is supported by the sensor. | |
| 19 interface SensorFactory { | |
|
Ken Rockot(use gerrit already)
2016/06/28 16:18:29
nit: Maybe SensorProvider? It's not really a facto
shalamov
2016/06/29 15:02:17
Done.
| |
| 20 CreateSensor(SensorType type, Sensor& sensor_request) => ( | |
| 21 Result result, | |
| 22 handle<shared_buffer>? shmem, | |
| 23 uint64 offset, | |
| 24 uint64 size, | |
| 25 ReportingMode mode); | |
| 26 }; | |
|
Ken Rockot(use gerrit already)
2016/06/28 16:18:29
If the only thing you can do is "Create" Sensor, a
shalamov
2016/06/29 15:02:17
Unfortunately, it is a more complex.
On browser s
Ken Rockot(use gerrit already)
2016/06/29 15:03:48
OK but why not just have each JS instance get its
| |
| OLD | NEW |