Bug 212407 - [WebXR] Implement XRSession::requestReferenceSpace()
Summary: [WebXR] Implement XRSession::requestReferenceSpace()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sergio Villar Senin
URL:
Keywords: InRadar
Depends on:
Blocks: 208988
  Show dependency treegraph
 
Reported: 2020-05-27 06:58 PDT by Sergio Villar Senin
Modified: 2020-05-29 09:37 PDT (History)
8 users (show)

See Also:


Attachments
Patch (18.08 KB, patch)
2020-05-27 07:09 PDT, Sergio Villar Senin
youennf: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergio Villar Senin 2020-05-27 06:58:49 PDT
[WebXR] Implement XRSession::requestReferenceSpace()
Comment 1 Sergio Villar Senin 2020-05-27 07:09:03 PDT
Created attachment 400331 [details]
Patch
Comment 2 Sergio Villar Senin 2020-05-28 09:09:00 PDT
Gentle ping
Comment 3 youenn fablet 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?
Comment 4 Sergio Villar Senin 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.
Comment 5 Sergio Villar Senin 2020-05-29 09:36:59 PDT
Committed r262299: <https://trac.webkit.org/changeset/262299>
Comment 6 Radar WebKit Bug Importer 2020-05-29 09:37:18 PDT
<rdar://problem/63762051>