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

Unified Diff: third_party/WebKit/Source/modules/vr/VRController.h

Issue 1808203005: [OnionSoup] Moving VR service from content to Blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to ToT! Created 4 years, 8 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: 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..adeafbe94c0504d66dbcb6dbd30fa84f01c2abb8 100644
--- a/third_party/WebKit/Source/modules/vr/VRController.h
+++ b/third_party/WebKit/Source/modules/vr/VRController.h
@@ -7,12 +7,15 @@
#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"
namespace blink {
+class ServiceRegistry;
+class VRGetDevicesCallback;
+
class MODULES_EXPORT VRController final
: public GarbageCollectedFinalized<VRController>
, public Supplement<LocalFrame>
@@ -22,25 +25,32 @@ class MODULES_EXPORT VRController final
public:
virtual ~VRController();
- void getDevices(WebVRGetDevicesCallback*);
+ void getDevices(VRGetDevicesCallback*);
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<VRGetDevicesCallback*> m_pendingGetDevicesCallbacks;
+ // SensorState is returned synchronously. No need for storing multiple requests.
+ WebHMDSensorState* m_pendingSensorStateRequest;
+ mojom::VRServicePtr m_service;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698