| Index: third_party/WebKit/Source/modules/vr/VRDisplay.h
|
| diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.h b/third_party/WebKit/Source/modules/vr/VRDisplay.h
|
| index ee60f0e7bd5f76cfb04bbab068ba2b329cd6f268..74fef1f03ff37a4790bd8c0319da266d3027db06 100644
|
| --- a/third_party/WebKit/Source/modules/vr/VRDisplay.h
|
| +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.h
|
| @@ -11,6 +11,7 @@
|
| #include "device/vr/vr_service.mojom-blink.h"
|
| #include "modules/vr/VRDisplayCapabilities.h"
|
| #include "modules/vr/VRLayer.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
| #include "platform/Timer.h"
|
| #include "platform/heap/Handle.h"
|
| #include "public/platform/WebGraphicsContext3DProvider.h"
|
| @@ -37,8 +38,10 @@ class WebGLRenderingContextBase;
|
| enum VREye { VREyeNone, VREyeLeft, VREyeRight };
|
|
|
| class VRDisplay final : public GarbageCollectedFinalized<VRDisplay>,
|
| + public device::blink::VRDisplayService,
|
| public ScriptWrappable {
|
| DEFINE_WRAPPERTYPEINFO();
|
| + USING_PRE_FINALIZER(VRDisplay, shutdownMessagePipe);
|
|
|
| public:
|
| ~VRDisplay();
|
| @@ -62,6 +65,10 @@ class VRDisplay final : public GarbageCollectedFinalized<VRDisplay>,
|
| void setDepthNear(double value) { m_depthNear = value; }
|
| void setDepthFar(double value) { m_depthFar = value; }
|
|
|
| + void setService(device::blink::VRDeviceServicePtr service) {
|
| + m_service = std::move(service);
|
| + }
|
| +
|
| VREyeParameters* getEyeParameters(const String&);
|
|
|
| int requestAnimationFrame(FrameRequestCallback*);
|
| @@ -95,6 +102,14 @@ class VRDisplay final : public GarbageCollectedFinalized<VRDisplay>,
|
|
|
| private:
|
| void onFullscreenCheck(TimerBase*);
|
| + void RegisterDisplayService();
|
| + void onPresentComplete(ScriptPromiseResolver*, bool);
|
| +
|
| + // VRDisplayService
|
| + void OnDisplayChanged(device::blink::VRDisplayPtr) override;
|
| + void OnExitPresent() override;
|
| + void OnDisplayConnected(device::blink::VRDisplayPtr) override;
|
| + void OnDisplayDisconnected() override;
|
|
|
| Member<NavigatorVR> m_navigatorVR;
|
| unsigned m_displayId;
|
| @@ -112,9 +127,16 @@ class VRDisplay final : public GarbageCollectedFinalized<VRDisplay>,
|
| double m_depthNear;
|
| double m_depthFar;
|
|
|
| + // Help VRController shutdown message pipe.
|
| + void shutdownMessagePipe();
|
| +
|
| Timer<VRDisplay> m_fullscreenCheckTimer;
|
| gpu::gles2::GLES2Interface* m_contextGL;
|
| Member<WebGLRenderingContextBase> m_renderingContext;
|
| +
|
| + device::blink::VRDeviceServicePtr m_service;
|
| +
|
| + mojo::Binding<device::blink::VRDisplayService> m_binding;
|
| };
|
|
|
| using VRDisplayVector = HeapVector<Member<VRDisplay>>;
|
|
|