Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: device/generic_sensor/sensor_provider_impl.h

Issue 2368193003: [sensors] Introduce asynchronous way to create sensors. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/generic_sensor/sensor_provider_impl.h
diff --git a/device/generic_sensor/sensor_provider_impl.h b/device/generic_sensor/sensor_provider_impl.h
index b46d59ac5224f0579408b1e3e2a046ed9dbdaae9..1a298e39e9c83e8920ae7a00b92ee35a6908bf2b 100644
--- a/device/generic_sensor/sensor_provider_impl.h
+++ b/device/generic_sensor/sensor_provider_impl.h
@@ -11,6 +11,7 @@
namespace device {
class PlatformSensorProvider;
+class PlatformSensor;
// Implementation of SensorProvider mojo interface.
// Uses PlatformSensorProvider singleton to create platform specific instances
@@ -29,8 +30,20 @@ class SensorProviderImpl final : public mojom::SensorProvider {
mojom::SensorRequest sensor_request,
const GetSensorCallback& callback) override;
+ // Helper callback method to create sensors.
+ void CreateSensor(mojom::SensorType type,
+ mojo::ScopedSharedBufferHandle cloned_handle,
+ mojom::SensorRequest sensor_request,
+ const GetSensorCallback& callback,
+ scoped_refptr<PlatformSensor> sensor);
+
+ using CreateSensorCallback =
Mikhail 2016/09/26 09:52:23 we don't need it in this header.
maksims (do not use this acc) 2016/09/27 10:17:25 Done.
+ base::Callback<void(scoped_refptr<PlatformSensor>)>;
+
PlatformSensorProvider* provider_;
+ base::WeakPtrFactory<SensorProviderImpl> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(SensorProviderImpl);
};

Powered by Google App Engine
This is Rietveld 408576698