Chromium Code Reviews| Index: device/sensors/public/interfaces/sensor_factory.mojom |
| diff --git a/device/sensors/public/interfaces/sensor_factory.mojom b/device/sensors/public/interfaces/sensor_factory.mojom |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..0320ba63f67bda61e4d928e48312d73cb89f63d1 |
| --- /dev/null |
| +++ b/device/sensors/public/interfaces/sensor_factory.mojom |
| @@ -0,0 +1,26 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +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.
|
| + |
| +import "sensor.mojom"; |
| + |
| +// Interface that allows its clients to create instances of Sensor inerface. |
| +// |
| +// @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.
|
| +// @param sensor_request - Sensor interface that is initialized by the factory. |
| +// @return result - Result of the request, SUCCESS on success, FAILURE otherwise. |
| +// @return shmem - SharedBuffer handle that is used by the client to fetch |
| +// sensor reading, or null if the request has failed. |
| +// @return offset - The offset at which SharedBuffer must be mapped by client. |
| +// @return size - The size of a sensor reading. |
| +// @return mode - The ReportingMode that is supported by the sensor. |
| +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.
|
| + CreateSensor(SensorType type, Sensor& sensor_request) => ( |
| + Result result, |
| + handle<shared_buffer>? shmem, |
| + uint64 offset, |
| + uint64 size, |
| + ReportingMode mode); |
| +}; |
|
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
|