Chromium Code Reviews| Index: third_party/WebKit/Source/modules/vr/VRController.h |
| diff --git a/third_party/WebKit/Source/modules/vr/VRController.h b/third_party/WebKit/Source/modules/vr/VRController.h |
| index eb4e0eaa41bc5c2d2b779aefcdcf36cc6977296f..2eadbdfdba1a5819bb79deebc135acca1decf899 100644 |
| --- a/third_party/WebKit/Source/modules/vr/VRController.h |
| +++ b/third_party/WebKit/Source/modules/vr/VRController.h |
| @@ -7,12 +7,16 @@ |
| #include "core/frame/LocalFrameLifecycleObserver.h" |
| #include "modules/ModulesExport.h" |
| +#include "modules/vr/VRTypeConverters.h" |
| #include "platform/Supplementable.h" |
| -#include "public/platform/modules/vr/WebVR.h" |
| -#include "public/platform/modules/vr/WebVRClient.h" |
| +#include "wtf/Deque.h" |
| +#include "wtf/PassOwnPtr.h" |
| namespace blink { |
| +class ServiceRegistry; |
| +class VRGetDevicesCallback; |
| + |
| class MODULES_EXPORT VRController final |
| : public GarbageCollectedFinalized<VRController> |
| , public Supplement<LocalFrame> |
| @@ -22,25 +26,32 @@ class MODULES_EXPORT VRController final |
| public: |
| virtual ~VRController(); |
| - void getDevices(WebVRGetDevicesCallback*); |
| + void getDevices(PassOwnPtr<VRGetDevicesCallback>); |
|
dcheng
2016/04/28 19:59:44
Use std::unique_ptr in new code, here and elsewher
RaviKasibhatla
2016/04/29 14:49:05
IIRC, @yutak recently sent a broadcast that the tr
dcheng
2016/04/29 17:28:11
No, new code should just use std::unique_ptr. It w
RaviKasibhatla
2016/05/03 14:34:21
Done.
|
| void getSensorState(unsigned index, WebHMDSensorState& into); |
| void resetSensor(unsigned index); |
| - static void provideTo(LocalFrame&, WebVRClient*); |
| + static void provideTo(LocalFrame&, ServiceRegistry*); |
| static VRController* from(LocalFrame&); |
| static const char* supplementName(); |
| DECLARE_VIRTUAL_TRACE(); |
| private: |
| - VRController(LocalFrame&, WebVRClient*); |
| + VRController(LocalFrame&, ServiceRegistry*); |
| // Inherited from LocalFrameLifecycleObserver. |
| void willDetachFrameHost() override; |
| - WebVRClient* m_client; |
| + // Binding callbacks. |
| + void OnGetDevices(const mojo::Array<mojom::VRDeviceInfoPtr>&); |
| + void OnGetSensorState(const mojom::VRSensorStatePtr&); |
| + |
| + WTF::Deque<OwnPtr<VRGetDevicesCallback>> m_pendingGetDevicesCallbacks; |
| + // SensorState is returned synchronously. No need for storing multiple requests. |
| + WebHMDSensorState* m_pendingSensorStateRequest; |
|
haraken
2016/04/28 14:50:03
Why does this need to be a pointer?
RaviKasibhatla
2016/04/28 18:08:33
getSensorState() passes a reference to WebHMDSenso
haraken
2016/04/28 19:16:15
How can the caller of getSensorState() know the ti
|
| + mojom::VRServicePtr m_service; |
| }; |
| } // namespace blink |