WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
187337
[WebVR] Fix VRDisplayEvent implementation
https://bugs.webkit.org/show_bug.cgi?id=187337
Summary
[WebVR] Fix VRDisplayEvent implementation
Sergio Villar Senin
Reported
2018-07-05 01:39:19 PDT
[WebVR] Fix VRDisplayEvent implementation
Attachments
Patch
(3.78 KB, patch)
2018-07-05 01:42 PDT
,
Sergio Villar Senin
no flags
Details
Formatted Diff
Diff
Patch for landing
(3.78 KB, patch)
2018-07-05 03:32 PDT
,
Sergio Villar Senin
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Sergio Villar Senin
Comment 1
2018-07-05 01:42:11 PDT
Created
attachment 344313
[details]
Patch
Zan Dobersek
Comment 2
2018-07-05 02:56:14 PDT
Comment on
attachment 344313
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=344313&action=review
> Source/WebCore/Modules/webvr/VRDisplayEvent.h:36 > + static Ref<VRDisplayEvent> create(const AtomicString& type, const RefPtr<VRDisplay>& display, const std::optional<VRDisplayEventReason>& reason)
Can display and reason arguments be rvalue references, enabling moving them down to the constructor and there into the member variables?
> Source/WebCore/Modules/webvr/VRDisplayEvent.h:54 > + std::optional<VRDisplayEventReason> reason() const { return m_reason; }
Can this return a const reference to the std::optional<>? It would then be up to the caller to copy it if necessary.
Sergio Villar Senin
Comment 3
2018-07-05 02:58:34 PDT
(In reply to Zan Dobersek from
comment #2
)
> Comment on
attachment 344313
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=344313&action=review
> > > Source/WebCore/Modules/webvr/VRDisplayEvent.h:36 > > + static Ref<VRDisplayEvent> create(const AtomicString& type, const RefPtr<VRDisplay>& display, const std::optional<VRDisplayEventReason>& reason) > > Can display and reason arguments be rvalue references, enabling moving them > down to the constructor and there into the member variables?
The reason can, but the VRDisplay cannot as they belong to somewhere else
> > Source/WebCore/Modules/webvr/VRDisplayEvent.h:54 > > + std::optional<VRDisplayEventReason> reason() const { return m_reason; } > > Can this return a const reference to the std::optional<>? It would then be > up to the caller to copy it if necessary.
OK
Sergio Villar Senin
Comment 4
2018-07-05 03:32:23 PDT
Created
attachment 344316
[details]
Patch for landing
Sergio Villar Senin
Comment 5
2018-07-05 03:40:46 PDT
(In reply to Zan Dobersek from
comment #2
)
> Comment on
attachment 344313
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=344313&action=review
> > > Source/WebCore/Modules/webvr/VRDisplayEvent.h:36 > > + static Ref<VRDisplayEvent> create(const AtomicString& type, const RefPtr<VRDisplay>& display, const std::optional<VRDisplayEventReason>& reason) > > Can display and reason arguments be rvalue references, enabling moving them > down to the constructor and there into the member variables? > > > Source/WebCore/Modules/webvr/VRDisplayEvent.h:54 > > + std::optional<VRDisplayEventReason> reason() const { return m_reason; } > > Can this return a const reference to the std::optional<>? It would then be > up to the caller to copy it if necessary.
I forgot to add this last change, I'll add it to a follow-up patch
Sergio Villar Senin
Comment 6
2018-07-05 04:42:07 PDT
Committed
r233515
: <
https://trac.webkit.org/changeset/233515
>
Radar WebKit Bug Importer
Comment 7
2018-07-05 04:43:20 PDT
<
rdar://problem/41843918
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug