Bug 215563 - NetworkSocketChannel should delay sending back error message as done by NetworkSocketStream
Summary: NetworkSocketChannel should delay sending back error message as done by Netwo...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-17 03:17 PDT by youenn fablet
Modified: 2020-08-18 08:17 PDT (History)
2 users (show)

See Also:


Attachments
Patch (3.92 KB, patch)
2020-08-17 03:20 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2020-08-17 03:17:58 PDT
Delay sending back to WebProcess WebSocket error message as done in NetworkSocketStream
Comment 1 youenn fablet 2020-08-17 03:20:51 PDT
Created attachment 406709 [details]
Patch
Comment 2 Alex Christensen 2020-08-17 09:03:05 PDT
Comment on attachment 406709 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=406709&action=review

> Source/WebKit/NetworkProcess/NetworkSocketChannel.h:94
> +    String m_errorMessage;

It would be nice if we could make a version of Timer::startOneShot that takes a lambda so these could be in a lambda capture instead of members of this object.

> Source/WebKit/NetworkProcess/NetworkSocketChannel.h:95
> +    Optional<std::pair<unsigned short, String>> m_closeInfo;

Could we make this uint16_t?
Comment 3 youenn fablet 2020-08-18 08:13:24 PDT
(In reply to Alex Christensen from comment #2)
> Comment on attachment 406709 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=406709&action=review
> 
> > Source/WebKit/NetworkProcess/NetworkSocketChannel.h:94
> > +    String m_errorMessage;
> 
> It would be nice if we could make a version of Timer::startOneShot that
> takes a lambda so these could be in a lambda capture instead of members of
> this object.

Agreed, but here we have two call sites, one for the error message and one for code and reason.

> > Source/WebKit/NetworkProcess/NetworkSocketChannel.h:95
> > +    Optional<std::pair<unsigned short, String>> m_closeInfo;
> 
> Could we make this uint16_t?

We probably could since it is an unsigned short for WebIDL as well.
But this would not be very consistent with other parts of the WebSocket implementation.
Comment 4 EWS 2020-08-18 08:16:06 PDT
Committed r265814: <https://trac.webkit.org/changeset/265814>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 406709 [details].
Comment 5 Radar WebKit Bug Importer 2020-08-18 08:17:17 PDT
<rdar://problem/67327819>