OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef VRDisplay_h | 5 #ifndef VRDisplay_h |
6 #define VRDisplay_h | 6 #define VRDisplay_h |
7 | 7 |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/dom/FrameRequestCallback.h" | 9 #include "core/dom/FrameRequestCallback.h" |
| 10 #include "core/dom/SuspendableObject.h" |
10 #include "core/events/EventTarget.h" | 11 #include "core/events/EventTarget.h" |
11 #include "device/vr/vr_service.mojom-blink.h" | 12 #include "device/vr/vr_service.mojom-blink.h" |
12 #include "modules/vr/VRDisplayCapabilities.h" | 13 #include "modules/vr/VRDisplayCapabilities.h" |
13 #include "modules/vr/VRLayer.h" | 14 #include "modules/vr/VRLayer.h" |
14 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
15 #include "platform/Timer.h" | 16 #include "platform/Timer.h" |
16 #include "platform/heap/Handle.h" | 17 #include "platform/heap/Handle.h" |
17 #include "platform/wtf/Forward.h" | 18 #include "platform/wtf/Forward.h" |
18 #include "platform/wtf/text/WTFString.h" | 19 #include "platform/wtf/text/WTFString.h" |
19 #include "public/platform/WebGraphicsContext3DProvider.h" | 20 #include "public/platform/WebGraphicsContext3DProvider.h" |
(...skipping 12 matching lines...) Expand all Loading... |
32 class VREyeParameters; | 33 class VREyeParameters; |
33 class VRFrameData; | 34 class VRFrameData; |
34 class VRStageParameters; | 35 class VRStageParameters; |
35 | 36 |
36 class WebGLRenderingContextBase; | 37 class WebGLRenderingContextBase; |
37 | 38 |
38 enum VREye { kVREyeNone, kVREyeLeft, kVREyeRight }; | 39 enum VREye { kVREyeNone, kVREyeLeft, kVREyeRight }; |
39 | 40 |
40 class VRDisplay final : public EventTargetWithInlineData, | 41 class VRDisplay final : public EventTargetWithInlineData, |
41 public ActiveScriptWrappable<VRDisplay>, | 42 public ActiveScriptWrappable<VRDisplay>, |
42 public ContextLifecycleObserver, | 43 public SuspendableObject, |
43 public device::mojom::blink::VRDisplayClient, | 44 public device::mojom::blink::VRDisplayClient, |
44 public device::mojom::blink::VRSubmitFrameClient { | 45 public device::mojom::blink::VRSubmitFrameClient { |
45 DEFINE_WRAPPERTYPEINFO(); | 46 DEFINE_WRAPPERTYPEINFO(); |
46 USING_GARBAGE_COLLECTED_MIXIN(VRDisplay); | 47 USING_GARBAGE_COLLECTED_MIXIN(VRDisplay); |
47 USING_PRE_FINALIZER(VRDisplay, Dispose); | 48 USING_PRE_FINALIZER(VRDisplay, Dispose); |
48 | 49 |
49 public: | 50 public: |
50 ~VRDisplay(); | 51 ~VRDisplay(); |
51 | 52 |
52 unsigned displayId() const { return display_id_; } | 53 unsigned displayId() const { return display_id_; } |
(...skipping 29 matching lines...) Expand all Loading... |
82 // EventTarget overrides: | 83 // EventTarget overrides: |
83 ExecutionContext* GetExecutionContext() const override; | 84 ExecutionContext* GetExecutionContext() const override; |
84 const AtomicString& InterfaceName() const override; | 85 const AtomicString& InterfaceName() const override; |
85 | 86 |
86 // ContextLifecycleObserver implementation. | 87 // ContextLifecycleObserver implementation. |
87 void ContextDestroyed(ExecutionContext*) override; | 88 void ContextDestroyed(ExecutionContext*) override; |
88 | 89 |
89 // ScriptWrappable implementation. | 90 // ScriptWrappable implementation. |
90 bool HasPendingActivity() const final; | 91 bool HasPendingActivity() const final; |
91 | 92 |
| 93 // SuspendableObject: |
| 94 void Suspend() override; |
| 95 void Resume() override; |
| 96 |
92 void FocusChanged(); | 97 void FocusChanged(); |
93 | 98 |
94 DECLARE_VIRTUAL_TRACE(); | 99 DECLARE_VIRTUAL_TRACE(); |
95 | 100 |
96 protected: | 101 protected: |
97 friend class VRController; | 102 friend class VRController; |
98 | 103 |
99 VRDisplay(NavigatorVR*, | 104 VRDisplay(NavigatorVR*, |
100 device::mojom::blink::VRDisplayPtr, | 105 device::mojom::blink::VRDisplayPtr, |
101 device::mojom::blink::VRDisplayClientRequest); | 106 device::mojom::blink::VRDisplayClientRequest); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 kRequestDenied = 12, | 234 kRequestDenied = 12, |
230 kFullscreenNotEnabled = 13, | 235 kFullscreenNotEnabled = 13, |
231 kPresentationResultMax, // Must be last member of enum. | 236 kPresentationResultMax, // Must be last member of enum. |
232 }; | 237 }; |
233 | 238 |
234 void ReportPresentationResult(PresentationResult); | 239 void ReportPresentationResult(PresentationResult); |
235 | 240 |
236 } // namespace blink | 241 } // namespace blink |
237 | 242 |
238 #endif // VRDisplay_h | 243 #endif // VRDisplay_h |
OLD | NEW |