Bug 208391

Summary: [WinCairo][PlayStation] Add interface to get listening port of RemoteInspectorServer
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: PlatformAssignee: Basuke Suzuki <Basuke.Suzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: Basuke.Suzuki, commit-queue, don.olmstead, ews-watchlist, hi, joepeck, keith_miller, mark.lam, msaboff, ross.kirsling, saam, tzagallo, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 208349    
Attachments:
Description Flags
PATCH
none
PATCH none

Description Basuke Suzuki 2020-02-28 13:58:07 PST
Current implementation cannot allow client to specify server address to listen. It is safe to specify "127.0.0.1" when no access from outside is needed. Also if server picks port number available, it is also handy.
Comment 1 Basuke Suzuki 2020-03-03 10:44:46 PST
Change the title. Now client can get the listening port when passing zero as a port number to allow system to pick an available port.
Comment 2 Basuke Suzuki 2020-03-03 10:48:51 PST
Created attachment 392296 [details]
PATCH
Comment 3 Ross Kirsling 2020-03-03 10:53:58 PST
Comment on attachment 392296 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:61
> +    if (isRunning())
> +        return WTF::nullopt;

Shouldn't this condition be negative?
Comment 4 Ross Kirsling 2020-03-03 10:56:02 PST
Comment on attachment 392296 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:52
>      auto& endpoint = Inspector::RemoteInspectorSocketEndpoint::singleton();
> +    if (isRunning())
> +        return false;

Also it seems like the early out can precede the declaration here.
Comment 5 Don Olmstead 2020-03-03 11:00:05 PST
Comment on attachment 392296 [details]
PATCH

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

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.cpp:53
> +    if (isRunning())
> +        return false;
> +

Shouldn't this go at the start? You don't use endpoint before this check.

> Source/JavaScriptCore/inspector/remote/socket/RemoteInspectorServer.h:42
> +    JS_EXPORT_PRIVATE Optional<uint16_t> RemoteInspectorServer::getPort();

Copy pasta error?
Comment 6 Basuke Suzuki 2020-03-03 11:26:10 PST
Comment on attachment 392296 [details]
PATCH

Sorry for too many casual mistake.
Comment 7 Basuke Suzuki 2020-03-03 11:35:49 PST
Created attachment 392304 [details]
PATCH

I got a coffee. My brain is now working.
Comment 8 WebKit Commit Bot 2020-03-03 12:24:15 PST
Comment on attachment 392304 [details]
PATCH

Clearing flags on attachment: 392304

Committed r257795: <https://trac.webkit.org/changeset/257795>
Comment 9 WebKit Commit Bot 2020-03-03 12:24:17 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2020-03-03 12:25:17 PST
<rdar://problem/60007846>