RESOLVED FIXED 212407
[WebXR] Implement XRSession::requestReferenceSpace()
https://bugs.webkit.org/show_bug.cgi?id=212407
Summary [WebXR] Implement XRSession::requestReferenceSpace()
Sergio Villar Senin
Reported 2020-05-27 06:58:49 PDT
[WebXR] Implement XRSession::requestReferenceSpace()
Attachments
Patch (18.08 KB, patch)
2020-05-27 07:09 PDT, Sergio Villar Senin
youennf: review+
Sergio Villar Senin
Comment 1 2020-05-27 07:09:03 PDT
Sergio Villar Senin
Comment 2 2020-05-28 09:09:00 PDT
Gentle ping
youenn fablet
Comment 3 2020-05-28 10:27:25 PDT
Comment on attachment 400331 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400331&action=review > Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.h:42 > + static Ref<WebXRBoundedReferenceSpace> create(ScriptExecutionContext*, WebXRSession&, XRReferenceSpaceType); Can we use a Document& and a Ref<WebXRSession>&&? > Source/WebCore/Modules/webxr/WebXRSession.cpp:88 > +bool WebXRSession::referenceSpaceIsSupported(const XRReferenceSpaceType& type) const s/const XRReferenceSpaceType& type/XRReferenceSpaceType type/ > Source/WebCore/Modules/webxr/WebXRSession.cpp:128 > +void WebXRSession::requestReferenceSpace(const XRReferenceSpaceType& type, RequestReferenceSpacePromise&& promise) s/const XRReferenceSpaceType& type/XRReferenceSpaceType type/ > Source/WebCore/Modules/webxr/WebXRSession.cpp:132 > + scriptExecutionContext()->postTask([this, promise = WTFMove(promise), type] (ScriptExecutionContext&) mutable { scriptExecutionContext() might be null. s/ScriptExecutionContext&/auto&/ > Source/WebCore/Modules/webxr/WebXRSession.cpp:149 > + promise.resolve(*referenceSpace); referenceSpace.releaseNonNull() > Source/WebCore/Modules/webxr/WebXRSpace.h:32 > +#include <wtf/IsoMalloc.h> Why do we need this one?
Sergio Villar Senin
Comment 4 2020-05-29 09:33:41 PDT
Comment on attachment 400331 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400331&action=review Thanks for the review! >> Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.h:42 >> + static Ref<WebXRBoundedReferenceSpace> create(ScriptExecutionContext*, WebXRSession&, XRReferenceSpaceType); > > Can we use a Document& and a Ref<WebXRSession>&&? We could indeed pass a Document&, I just used the ScriptExecutionContext* because that's what ContextDestructionObserver expects in the end but I can change it. Regarding a ref to the session yeah we could do that as well as the session does not keep any reference to the reference spaces so there is no risk of ref cycles. >> Source/WebCore/Modules/webxr/WebXRSession.cpp:88 >> +bool WebXRSession::referenceSpaceIsSupported(const XRReferenceSpaceType& type) const > > s/const XRReferenceSpaceType& type/XRReferenceSpaceType type/ right. >> Source/WebCore/Modules/webxr/WebXRSession.cpp:128 >> +void WebXRSession::requestReferenceSpace(const XRReferenceSpaceType& type, RequestReferenceSpacePromise&& promise) > > s/const XRReferenceSpaceType& type/XRReferenceSpaceType type/ ok >> Source/WebCore/Modules/webxr/WebXRSession.cpp:132 >> + scriptExecutionContext()->postTask([this, promise = WTFMove(promise), type] (ScriptExecutionContext&) mutable { > > scriptExecutionContext() might be null. > s/ScriptExecutionContext&/auto&/ OK >> Source/WebCore/Modules/webxr/WebXRSession.cpp:149 >> + promise.resolve(*referenceSpace); > > referenceSpace.releaseNonNull() right >> Source/WebCore/Modules/webxr/WebXRSpace.h:32 >> +#include <wtf/IsoMalloc.h> > > Why do we need this one? I don't see any reason.
Sergio Villar Senin
Comment 5 2020-05-29 09:36:59 PDT
Radar WebKit Bug Importer
Comment 6 2020-05-29 09:37:18 PDT
Note You need to log in before you can comment on or make changes to this bug.