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

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

Issue 1906883002: [Do Not Commit] Migrate vr service from content/renderer/ to WebKit/platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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..9ce0eab0999425914c7fe7bb999b0ff89fe69724 100644
--- a/third_party/WebKit/Source/modules/vr/VRController.h
+++ b/third_party/WebKit/Source/modules/vr/VRController.h
@@ -8,11 +8,19 @@
#include "core/frame/LocalFrameLifecycleObserver.h"
#include "modules/ModulesExport.h"
#include "platform/Supplementable.h"
+#include "public/platform/WebCallbacks.h"
+#include "public/platform/WebVector.h"
#include "public/platform/modules/vr/WebVR.h"
-#include "public/platform/modules/vr/WebVRClient.h"
+#include "public/platform/modules/vr/vr_service.mojom-wtf.h"
+#include "wtf/Vector.h"
namespace blink {
+class ServiceRegistry;
+
+// Success and failure callbacks for getDevices.
+using WebVRGetDevicesCallback = WebCallbacks<const WebVector<WebVRDevice>&, void>;
+
class MODULES_EXPORT VRController final
: public GarbageCollectedFinalized<VRController>
, public Supplement<LocalFrame>
@@ -24,23 +32,32 @@ public:
void getDevices(WebVRGetDevicesCallback*);
- void getSensorState(unsigned index, WebHMDSensorState& into);
+ 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*);
+
+ mojom::wtf::VRServicePtr& service();
+
+ // Callback handlers
+ void OnGetDevices(const mojo::WTFArray<mojom::wtf::VRDeviceInfoPtr>& devices);
+ void OnGetSensorState(const mojom::wtf::VRSensorStatePtr& mojoState);
// Inherited from LocalFrameLifecycleObserver.
void willDetachFrameHost() override;
- WebVRClient* m_client;
+ ServiceRegistry* m_registry;
+ mojom::wtf::VRServicePtr m_service;
+ WebHMDSensorState* m_pendingState;
+ Vector<OwnPtr<WebVRGetDevicesCallback>> m_pendingDeviceRequests;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/modules.gypi ('k') | third_party/WebKit/Source/modules/vr/VRController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698